diff options
author | Koni Marti <koni.marti@gmail.com> | 2022-04-18 16:21:54 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-04-25 11:22:04 +0200 |
commit | 25a8a00c558d0548944843df1a35b1db6aa4bfd2 (patch) | |
tree | 3d1aa1ad6377962cc80ddbab0b59694266c651b4 | |
parent | ce18e928813526e59462e391c09e868c62facb42 (diff) | |
download | aerc-25a8a00c558d0548944843df1a35b1db6aa4bfd2.tar.gz |
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 <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r-- | commands/account/search.go | 3 |
1 files changed, 3 insertions, 0 deletions
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, " "))) |