mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-14 11:45:48 -07:00
Remove invalid 'result' event when using --sync option
When the search for the initial query doesn't finish immediately fzf would trigger an invalid 'result' event for an empty query. seq 100 | fzf --query 99 --bind result:accept --sync # Prints 99 seq 1000000 | fzf --query 99 --bind result:accept --sync # Should print 99, but fzf would print 1
This commit is contained in:
@@ -298,8 +298,7 @@ func Run(opts *Options, version string, revision string) {
|
||||
total = count
|
||||
terminal.UpdateCount(total, !reading, value.(*string))
|
||||
if opts.Sync {
|
||||
opts.Sync = false
|
||||
terminal.UpdateList(PassMerger(&snapshot, opts.Tac, snapshotRevision))
|
||||
terminal.UpdateList(PassMerger(&snapshot, opts.Tac, snapshotRevision), false)
|
||||
}
|
||||
if heightUnknown && !deferred {
|
||||
determine(!reading)
|
||||
@@ -384,7 +383,7 @@ func Run(opts *Options, version string, revision string) {
|
||||
determine(val.final)
|
||||
}
|
||||
}
|
||||
terminal.UpdateList(val)
|
||||
terminal.UpdateList(val, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user