filter/search: display current search/filter arguments

Make the statusbar message after search and filter completion more
informative by showing the full call that was used.

Signed-off-by: inwit <inwit@sindominio.net>
This commit is contained in:
inwit 2022-02-19 17:26:10 +01:00 committed by Robin Jarry
parent 287df9defb
commit c37f1eaaea
1 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package account
import ( import (
"errors" "errors"
"fmt"
"git.sr.ht/~rjarry/aerc/widgets" "git.sr.ht/~rjarry/aerc/widgets"
) )
@ -34,14 +35,14 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error {
if args[0] == "filter" { if args[0] == "filter" {
aerc.SetStatus("Filtering...") aerc.SetStatus("Filtering...")
cb = func(uids []uint32) { cb = func(uids []uint32) {
aerc.SetStatus("Filter complete.") aerc.SetStatus(fmt.Sprintf("Filter complete %s", args))
acct.Logger().Printf("Filter results: %v", uids) acct.Logger().Printf("Filter results: %v", uids)
store.ApplyFilter(uids) store.ApplyFilter(uids)
} }
} else { } else {
aerc.SetStatus("Searching...") aerc.SetStatus("Searching...")
cb = func(uids []uint32) { cb = func(uids []uint32) {
aerc.SetStatus("Search complete.") aerc.SetStatus(fmt.Sprintf("Search complete %s", args))
acct.Logger().Printf("Search results: %v", uids) acct.Logger().Printf("Search results: %v", uids)
store.ApplySearch(uids) store.ApplySearch(uids)
// TODO: Remove when stores have multiple OnUpdate handlers // TODO: Remove when stores have multiple OnUpdate handlers