From e3842033904af9f4fc0e829b6f23de0579453052 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Sat, 19 Feb 2022 22:26:47 +0100 Subject: [PATCH] search/filter: remove from status bar after 20 seconds The status is not cleared. It is annoying. Fixes: c37f1eaaeaa1 ("filter/search: display current search/filter arguments") Signed-off-by: Robin Jarry --- commands/account/search.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/commands/account/search.go b/commands/account/search.go index be4df9d..e12f972 100644 --- a/commands/account/search.go +++ b/commands/account/search.go @@ -3,6 +3,7 @@ package account import ( "errors" "fmt" + "time" "git.sr.ht/~rjarry/aerc/widgets" ) @@ -33,16 +34,16 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { var cb func([]uint32) if args[0] == "filter" { - aerc.SetStatus("Filtering...") + aerc.PushStatus("Filtering...", 10*time.Second) cb = func(uids []uint32) { - aerc.SetStatus(fmt.Sprintf("Filter complete %s", args)) + aerc.PushStatus(fmt.Sprintf("Filter complete %s", args), 20*time.Second) acct.Logger().Printf("Filter results: %v", uids) store.ApplyFilter(uids) } } else { - aerc.SetStatus("Searching...") + aerc.PushStatus("Searching...", 10*time.Second) cb = func(uids []uint32) { - aerc.SetStatus(fmt.Sprintf("Search complete %s", args)) + aerc.PushStatus(fmt.Sprintf("Search complete %s", args), 20*time.Second) acct.Logger().Printf("Search results: %v", uids) store.ApplySearch(uids) // TODO: Remove when stores have multiple OnUpdate handlers