diff --git a/src/pattern.go b/src/pattern.go index fda5cc9a..42a341b4 100644 --- a/src/pattern.go +++ b/src/pattern.go @@ -227,7 +227,7 @@ func (p *Pattern) CacheKey() string { } cacheableTerms := []string{} for _, termSet := range p.termSets { - if len(termSet) == 1 && !termSet[0].inv { + if len(termSet) == 1 && !termSet[0].inv && (p.fuzzy || termSet[0].typ == termExact) { cacheableTerms = append(cacheableTerms, string(termSet[0].origText)) } } diff --git a/test/test_go.rb b/test/test_go.rb index 2c3ba2eb..2c1324b8 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -1157,6 +1157,16 @@ class TestGoFZF < TestBase end end + def test_partial_caching + tmux.send_keys 'seq 1000 | fzf -e', :Enter + tmux.until { |lines| lines[-2] == ' 1000/1000' } + tmux.send_keys 11 + tmux.until { |lines| lines[-2] == ' 19/1000' } + tmux.send_keys 'C-a', "'" + tmux.until { |lines| lines[-2] == ' 28/1000' } + tmux.send_keys :Enter + end + private def writelines path, lines File.unlink path while File.exists? path