summaryrefslogtreecommitdiffstats
path: root/src/pattern.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-10-04 02:09:03 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-10-04 02:09:03 +0900
commitaeb957a2852555b2fce037aac4c3cb2b9d2f5c39 (patch)
treeb33eeee4f5d89dd4e20f9c9de6655f9a89db0533 /src/pattern.go
parent154cf22ffaf8f629113e5b83a34c72805df02548 (diff)
Use exact match by default for inverse search term
This is a breaking change, but I believe it makes much more sense. It is almost impossible to predict which entries will be filtered out due to a fuzzy inverse term. You can still perform inverse-fuzzy-match by prepending `!'` to the term. | Token | Match type | Description | | -------- | -------------------------- | --------------------------------- | | `sbtrkt` | fuzzy-match | Items that match `sbtrkt` | | `^music` | prefix-exact-match | Items that start with `music` | | `.mp3$` | suffix-exact-match | Items that end with `.mp3` | | `'wild` | exact-match (quoted) | Items that include `wild` | | `!fire` | inverse-exact-match | Items that do not include `fire` | | `!.mp3$` | inverse-suffix-exact-match | Items that do not end with `.mp3` |
Diffstat (limited to 'src/pattern.go')
-rw-r--r--src/pattern.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pattern.go b/src/pattern.go
index 7e5f4289..82272af6 100644
--- a/src/pattern.go
+++ b/src/pattern.go
@@ -163,12 +163,13 @@ func parseTerms(fuzzy bool, caseMode Case, str string) []termSet {
if strings.HasPrefix(text, "!") {
inv = true
+ typ = termExact
text = text[1:]
}
if strings.HasPrefix(text, "'") {
// Flip exactness
- if fuzzy {
+ if fuzzy && !inv {
typ = termExact
text = text[1:]
} else {