mirror of
https://github.com/junegunn/fzf
synced 2024-11-10 13:10:44 +00:00
Treat $ as proper search query
When $ is the leading character in a query, it's probably not meant to be an anchor.
This commit is contained in:
parent
e55e029ae8
commit
02a7b96f33
@ -175,7 +175,7 @@ func parseTerms(fuzzy bool, caseMode Case, normalize bool, str string) []termSet
|
|||||||
text = text[1:]
|
text = text[1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasSuffix(text, "$") {
|
if text != "$" && strings.HasSuffix(text, "$") {
|
||||||
if strings.HasSuffix(text, "\\$") {
|
if strings.HasSuffix(text, "\\$") {
|
||||||
text = text[:len(text)-2] + "$"
|
text = text[:len(text)-2] + "$"
|
||||||
} else {
|
} else {
|
||||||
|
@ -58,7 +58,7 @@ func TestParseTermsExtendedExact(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestParseTermsEmpty(t *testing.T) {
|
func TestParseTermsEmpty(t *testing.T) {
|
||||||
terms := parseTerms(true, CaseSmart, false, "' $ ^ !' !^ !$")
|
terms := parseTerms(true, CaseSmart, false, "' ^ !' !^")
|
||||||
if len(terms) != 0 {
|
if len(terms) != 0 {
|
||||||
t.Errorf("%s", terms)
|
t.Errorf("%s", terms)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user