aboutsummaryrefslogtreecommitdiffstats
path: root/worker/notmuch/worker.go
diff options
context:
space:
mode:
authorKalyan Sriram <kalyan@coderkalyan.com>2021-11-13 06:31:16 +0000
committerRobin Jarry <robin@jarry.cc>2021-11-13 15:20:54 +0100
commitd7bda10f3e1f76f70fa67908d1631632e8498d16 (patch)
treeef8665274e6ce69e9009a51bcbe37c5cf7500a8b /worker/notmuch/worker.go
parentdc2a2c2dfd6dc327fe40fbf2da922ef6c3d520be (diff)
downloadaerc-d7bda10f3e1f76f70fa67908d1631632e8498d16.tar.gz
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
Diffstat (limited to 'worker/notmuch/worker.go')
-rw-r--r--worker/notmuch/worker.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go
index dc362af1..63003292 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