Fix caching scheme when --exact is set and '-prefix is used

This commit is contained in:
Junegunn Choi
2017-02-01 02:05:58 +09:00
parent 712b7b2188
commit dd1f26522c
2 changed files with 19 additions and 1 deletions

View File

@@ -101,7 +101,7 @@ func BuildPattern(fuzzy bool, fuzzyAlgo algo.Algo, extended bool, caseMode Case,
for idx, term := range termSet {
// If the query contains inverse search terms or OR operators,
// we cannot cache the search scope
if !cacheable || idx > 0 || term.inv {
if !cacheable || idx > 0 || term.inv || !fuzzy && term.typ != termExact {
cacheable = false
break Loop
}