From 25a8a00c558d0548944843df1a35b1db6aa4bfd2 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Mon, 18 Apr 2022 16:21:54 +0200 Subject: 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(+) (limited to 'commands/account/search.go') diff --git a/commands/account/search.go b/commands/account/search.go index eeee7bdb..771c850f 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, " "))) -- cgit