diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2017-08-10 12:40:53 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-08-10 12:40:53 +0900 |
commit | 6b18b144cf0a608433009515cddef74737bfce56 (patch) | |
tree | 33bf23b8eb698717dad678cfcedc6841f9870c59 /src/pattern.go | |
parent | 6d53089cc1857255be7f7a33c139128c092d6f9b (diff) |
Fix escaping of meta characters after ' or ! prefix
https://github.com/junegunn/fzf/issues/444#issuecomment-321432803
Diffstat (limited to 'src/pattern.go')
-rw-r--r-- | src/pattern.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/pattern.go b/src/pattern.go index c98f8ddc..00e3a3a6 100644 --- a/src/pattern.go +++ b/src/pattern.go @@ -182,7 +182,9 @@ func parseTerms(fuzzy bool, caseMode Case, normalize bool, str string) []termSet } } - if strings.HasPrefix(text, "'") { + if _escapedPrefixRegex.MatchString(text) { + text = text[1:] + } else if strings.HasPrefix(text, "'") { // Flip exactness if fuzzy && !inv { typ = termExact @@ -200,10 +202,6 @@ func parseTerms(fuzzy bool, caseMode Case, normalize bool, str string) []termSet text = text[1:] } - if _escapedPrefixRegex.MatchString(text) { - text = text[1:] - } - if len(text) > 0 { if switchSet { sets = append(sets, set) |