summaryrefslogtreecommitdiffstats
path: root/src/pattern.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pattern.go')
-rw-r--r--src/pattern.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pattern.go b/src/pattern.go
index 8029fd0c..dbb3983f 100644
--- a/src/pattern.go
+++ b/src/pattern.go
@@ -152,6 +152,7 @@ func parseTerms(fuzzy bool, caseMode Case, normalize bool, str string) []termSet
sets := []termSet{}
set := termSet{}
switchSet := false
+ afterBar := false
for _, token := range tokens {
typ, inv, text := termFuzzy, false, strings.Replace(token, "\t", " ", -1)
lowerText := strings.ToLower(text)
@@ -164,10 +165,12 @@ func parseTerms(fuzzy bool, caseMode Case, normalize bool, str string) []termSet
typ = termExact
}
- if text == "|" {
+ if len(set) > 0 && !afterBar && text == "|" {
switchSet = false
+ afterBar = true
continue
}
+ afterBar = false
if strings.HasPrefix(text, "!") {
inv = true