Skip to content
Myr

Treat $ as proper search query

Before adoption: this commit came in with the history the project adopted, so no landing records it.

When $ is the leading character in a query, it's probably not meant to be an anchor.

authored by Junegunn Choi · committed by Junegunn Choi · parent e55e029 · Browse files · 2 files+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−2 removed

  • other:+2 added−2 removed

2 files+2 added−2 removed

modified:src/pattern_test.go+1 added-1 removed
56 unmodified lines
57 }58}5960func TestParseTermsEmpty(t *testing.T) {61 terms := parseTerms(true, CaseSmart, false, "' $ ^ !' !^ !$")61 terms := parseTerms(true, CaseSmart, false, "' ^ !' !^")62 if len(terms) != 0 {63 t.Errorf("%s", terms)64 }65}
139 unmodified lines
modified:src/pattern.go+1 added-1 removed
173 unmodified lines
174 typ = termExact175 text = text[1:]176 }177178 if strings.HasSuffix(text, "$") {178 if text != "$" && strings.HasSuffix(text, "$") {179 if strings.HasSuffix(text, "\\$") {180 text = text[:len(text)-2] + "$"181 } else {182 typ = termSuffix
225 unmodified lines