mirror of
https://github.com/junegunn/fzf.git
synced 2026-10-07 20:54:41 +08:00
Fix stale progress in --listen status payload (#4907)
- progress was set to 100 by every UpdateList, partial results included, and never reset when a search started - So a GET could report a new query, the previous result set, and progress 100, and a client had no way to tell it was stale - Now cleared where the search is requested and set to 100 only on the final result. Query and the reset happen in the same locked section that dumpStatus locks, so query == X with progress 100 means the matches belong to X Fix #4903
This commit is contained in:
1 parent
1372d04f79
commit
7e6339979f
3 files changed
+29
-1
No files matched your search
+4
-1
@@ -2059,7 +2059,9 @@ func (t *Terminal) UpdateList(result MatchResult) {
|
||||
prevIndex = t.targetIndex
|
||||
t.targetIndex = minItem.Index()
|
||||
}
|
||||
t.progress = 100
|
||||
if result.final() {
|
||||
t.progress = 100
|
||||
}
|
||||
t.merger = merger
|
||||
t.resultMerger = merger
|
||||
t.passMerger = result.passMerger
|
||||
@@ -8597,6 +8599,7 @@ func (t *Terminal) Loop() error {
|
||||
reload := changed || newCommand != nil
|
||||
if reload {
|
||||
t.wait.searching = true
|
||||
t.progress = 0
|
||||
}
|
||||
var reloadRequest *searchRequest
|
||||
if reload {
|
||||
|
||||
Reference in new issue
Block a user