aboutsummaryrefslogtreecommitdiffstats
path: root/worker/notmuch/search.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/notmuch/search.go')
-rw-r--r--worker/notmuch/search.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/worker/notmuch/search.go b/worker/notmuch/search.go
index 36d4c2df..a84711eb 100644
--- a/worker/notmuch/search.go
+++ b/worker/notmuch/search.go
@@ -5,6 +5,7 @@ package notmuch
import (
"fmt"
+ "strings"
"git.sr.ht/~rjarry/aerc/models"
"git.sr.ht/~rjarry/aerc/worker/types"
@@ -88,11 +89,13 @@ func translate(crit *types.SearchCriteria) string {
}
// other terms
- if crit.Terms != "" {
+ if len(crit.Terms) > 0 {
if crit.SearchBody {
- base.and("body:" + opt.QuoteArg(crit.Terms))
+ base.and("body:" + opt.QuoteArg(strings.Join(crit.Terms, " ")))
} else {
- base.and(crit.Terms)
+ for _, term := range crit.Terms {
+ base.and(term)
+ }
}
}