From 13f1ad7c1d3a46e8acfac11004f7d2397a339274 Mon Sep 17 00:00:00 2001 From: techygrrrl Date: Wed, 3 May 2023 20:58:12 -0700 Subject: [PATCH] move resetting of the filters til last --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 3588a3a..93dfbfd 100644 --- a/main.go +++ b/main.go @@ -102,12 +102,12 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } else { // If accepted killing the port, grab PID + execute killPort() if m.activeButton == "yes" { - m.list.ResetFilter() rgx := regexp.MustCompile(`\((.*?)\)`) pid := rgx.FindStringSubmatch(m.list.SelectedItem().FilterValue())[1] killPort(pid) // Get running processes again when a process is killed m.list.SetItems(getProcesses()) + m.list.ResetFilter() } // In all cases, reset selected port at the end m.selectedPort = ""