From 25a8a00c558d0548944843df1a35b1db6aa4bfd2 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Mon, 18 Apr 2022 16:21:54 +0200 Subject: [PATCH] filter: clear filter when called with no args Clear filter when called with no arguments. Fixes: https://todo.sr.ht/~rjarry/aerc/35 Signed-off-by: Koni Marti Acked-by: Robin Jarry --- commands/account/search.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands/account/search.go b/commands/account/search.go index eeee7bd..771c850 100644 --- a/commands/account/search.go +++ b/commands/account/search.go @@ -34,6 +34,9 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { var cb func([]uint32) if args[0] == "filter" { + if len(args[1:]) == 0 { + return Clear{}.Execute(aerc, []string{"clear"}) + } acct.SetStatus(statusline.FilterActivity("Filtering..."), statusline.Search("")) cb = func(uids []uint32) { acct.SetStatus(statusline.FilterResult(strings.Join(args, " ")))