mirror of
https://github.com/F1bonacc1/process-compose.git
synced 2024-09-11 11:35:26 +03:00
Enhancement: Preserve process selection after exiting search
This commit is contained in:
parent
86b48d97a1
commit
7aab5a5187
@ -249,7 +249,9 @@ func (pv *pcView) matchProcRegex(procName string) bool {
|
||||
func (pv *pcView) resetProcessSearch() {
|
||||
pv.setProcRegex(nil)
|
||||
go pv.appView.QueueUpdateDraw(func() {
|
||||
name := pv.getSelectedProcName()
|
||||
pv.fillTableData()
|
||||
pv.selectTableProcess(name)
|
||||
})
|
||||
}
|
||||
|
||||
@ -350,3 +352,23 @@ func (pv *pcView) getTableRowValues(state types.ProcessState) tableRowValues {
|
||||
exitCode: getStrForExitCode(state),
|
||||
}
|
||||
}
|
||||
|
||||
func (pv *pcView) getSelectedProcName() string {
|
||||
if pv.procTable == nil {
|
||||
return ""
|
||||
}
|
||||
row, _ := pv.procTable.GetSelection()
|
||||
if row > 0 {
|
||||
return pv.procTable.GetCell(row, int(ProcessStateName)).Text
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (pv *pcView) selectTableProcess(name string) {
|
||||
for i := 1; i < pv.procTable.GetRowCount(); i++ {
|
||||
if pv.procTable.GetCell(i, int(ProcessStateName)).Text == name {
|
||||
pv.procTable.Select(i, 1)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -335,17 +335,6 @@ func (pv *pcView) handleConnectivityError() {
|
||||
}
|
||||
}
|
||||
|
||||
func (pv *pcView) getSelectedProcName() string {
|
||||
if pv.procTable == nil {
|
||||
return ""
|
||||
}
|
||||
row, _ := pv.procTable.GetSelection()
|
||||
if row > 0 {
|
||||
return pv.procTable.GetCell(row, int(ProcessStateName)).Text
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (pv *pcView) onProcRowSpanChange() {
|
||||
if pv.scrSplitState == ProcFull && pv.logFollow {
|
||||
pv.stopFollowLog()
|
||||
|
Loading…
Reference in New Issue
Block a user