about summary refs log tree commit diff stats
path: root/worker/notmuch/worker.go
diff options
context:
space:
mode:
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 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