aboutsummaryrefslogtreecommitdiffstats
path: root/worker/notmuch/worker.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/notmuch/worker.go')
-rw-r--r--worker/notmuch/worker.go19
1 files changed, 2 insertions, 17 deletions
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go
index f47f3889..70dca1e2 100644
--- a/worker/notmuch/worker.go
+++ b/worker/notmuch/worker.go
@@ -4,7 +4,6 @@
package notmuch
import (
- "bufio"
"bytes"
"context"
"errors"
@@ -610,22 +609,8 @@ func (w *worker) loadQueryMap(acctConfig *config.AccountConfig) error {
return err
}
defer f.Close()
- w.nameQueryMap = make(map[string]string)
- scanner := bufio.NewScanner(f)
- for scanner.Scan() {
- line := scanner.Text()
- if line == "" || line[0] == '#' {
- continue
- }
-
- split := strings.SplitN(line, "=", 2)
- if len(split) != 2 {
- return fmt.Errorf("%v: invalid line %q, want name=query", file, line)
- }
- w.nameQueryMap[strings.TrimSpace(split[0])] = split[1]
- w.queryMapOrder = append(w.queryMapOrder, strings.TrimSpace(split[0]))
- }
- return nil
+ w.nameQueryMap, w.queryMapOrder, err = lib.ParseFolderMap(f)
+ return err
}
func (w *worker) loadExcludeTags(