mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-21 12:25:09 +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 count == prevCount {
|
||||
// Look up mergerCache
|
||||
if cached, found := m.mergerCache[patternString]; found {
|
||||
if cached, found := m.mergerCache[patternString]; found && cached.final == request.final {
|
||||
merger = cached
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user