mirror of
https://github.com/junegunn/fzf.git
synced 2025-09-01 04:43:49 -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:
@@ -1067,7 +1067,7 @@ func (t *Terminal) UpdateProgress(progress float32) {
|
||||
}
|
||||
|
||||
// UpdateList updates Merger to display the list
|
||||
func (t *Terminal) UpdateList(merger *Merger) {
|
||||
func (t *Terminal) UpdateList(merger *Merger, triggerResultEvent bool) {
|
||||
t.mutex.Lock()
|
||||
prevIndex := minItem.Index()
|
||||
reset := t.revision != merger.Revision()
|
||||
@@ -1118,7 +1118,7 @@ func (t *Terminal) UpdateList(merger *Merger) {
|
||||
t.eventChan <- one
|
||||
}
|
||||
}
|
||||
if t.hasResultActions {
|
||||
if triggerResultEvent && t.hasResultActions {
|
||||
t.eventChan <- tui.Result.AsEvent()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user