diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2024-04-20 14:40:48 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2024-04-20 14:42:43 +0900 |
| commit | d8bfb6712d514fd6715135fd0e60df188831b566 (patch) | |
| tree | fcf807a109ce1793bbd275b7d25aad99b590517f /src/core.go | |
| parent | f864f8b5f7ab62e81fbf9eb2ac2333c7e52bb4e4 (diff) | |
| download | fzf-d8bfb6712d514fd6715135fd0e60df188831b566.tar.gz | |
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
Diffstat (limited to 'src/core.go')
| -rw-r--r-- | src/core.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core.go b/src/core.go index 3d84c733..ec137698 100644 --- a/src/core.go +++ b/src/core.go @@ -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) } } } |
