mirror of
https://github.com/junegunn/fzf
synced 2024-10-21 07:09:32 +00:00
Avoid selecting an outdated merger from cache
We cache a merger for partial input as well, because it is automatically invalidated as soon as the new data comes in. However, there was a race condition where a cached merger for a partial input is used even after the input stream was complete. This commit fixes the problem. Fix #4034
This commit is contained in:
parent
97f1dae2d1
commit
90a8800bb5
@ -102,7 +102,7 @@ func (m *Matcher) Loop() {
|
|||||||
if !cacheCleared {
|
if !cacheCleared {
|
||||||
if count == prevCount {
|
if count == prevCount {
|
||||||
// Look up mergerCache
|
// Look up mergerCache
|
||||||
if cached, found := m.mergerCache[patternString]; found {
|
if cached, found := m.mergerCache[patternString]; found && cached.final == request.final {
|
||||||
merger = cached
|
merger = cached
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user