Skip to content
Myr

Fix incorrect cache reference in --exact mode (#547)

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

When we prepend a single quote to our query in --exact mode, we are not supposed to limit the scope of the new search to the previous exact-match result.

authored by Junegunn Choi · committed by Junegunn Choi · parent 4bde8de · Browse files · 2 files+11 added−1 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+11 added−1 removed

  • tests:+10 added−0 removed
  • other:+1 added−1 removed

2 files+11 added−1 removed

modified:src/pattern.go+1 added-1 removed
225 unmodified lines
226 return p.AsString()227 }228 cacheableTerms := []string{}229 for _, termSet := range p.termSets {230 if len(termSet) == 1 && !termSet[0].inv {230 if len(termSet) == 1 && !termSet[0].inv && (p.fuzzy || termSet[0].typ == termExact) {231 cacheableTerms = append(cacheableTerms, string(termSet[0].origText))232 }233 }234 return strings.Join(cacheableTerms, " ")
148 unmodified lines
modified:test/test_go.rb+10 added
1155 unmodified lines
1156 tmux.send_keys :Enter1157 end1158 end11591160 def test_partial_caching1161 tmux.send_keys 'seq 1000 | fzf -e', :Enter1162 tmux.until { |lines| lines[-2] == ' 1000/1000' }1163 tmux.send_keys 111164 tmux.until { |lines| lines[-2] == ' 19/1000' }1165 tmux.send_keys 'C-a', "'"1166 tmux.until { |lines| lines[-2] == ' 28/1000' }1167 tmux.send_keys :Enter1168 end11691170private1171 def writelines path, lines1172 File.unlink path while File.exists? path1173 File.open(path, 'w') { |f| f << lines.join($/) + $/ }
305 unmodified lines