From d7bda10f3e1f76f70fa67908d1631632e8498d16 Mon Sep 17 00:00:00 2001 From: Kalyan Sriram Date: Sat, 13 Nov 2021 06:31:16 +0000 Subject: notmuch: allow empty searches Don't error on empty search terms, just don't filter by anything and return all items matching the current querymap --- worker/notmuch/worker.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'worker') diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go index dc362af..6300329 100644 --- a/worker/notmuch/worker.go +++ b/worker/notmuch/worker.go @@ -435,7 +435,10 @@ func (w *worker) handleSearchDirectory(msg *types.SearchDirectory) error { // the first item is the command (search / filter) s := strings.Join(msg.Argv[1:], " ") // we only want to search in the current query, so merge the two together - search := fmt.Sprintf("(%v) and (%v)", w.query, s) + search := w.query + if s != "" { + search = fmt.Sprintf("(%v) and (%v)", w.query, s) + } uids, err := w.uidsFromQuery(search) if err != nil { return err -- cgit 1.4.1-2-gfad0