mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-31 03:47:02 +08:00
Block 'start:wait' during initial load
- Init searchInProgress before reader starts so start:wait waits for the first complete result set instead of no-op'ing - Add test_wait_action_start
This commit is contained in:
+5
-1
@@ -1169,7 +1169,11 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
|
||||
lastAction: actStart,
|
||||
lastFocus: minItem.Index(),
|
||||
lastActivity: time.Now(),
|
||||
numLinesCache: make(map[int32]numLinesCacheValue)}
|
||||
// Consider the initial load a search in progress so 'start:wait' blocks
|
||||
// until the first result set is complete. Set here, before the reader
|
||||
// starts, so the first final() result correctly clears it.
|
||||
searchInProgress: true,
|
||||
numLinesCache: make(map[int32]numLinesCacheValue)}
|
||||
if opts.AcceptNth != nil {
|
||||
t.acceptNth = opts.AcceptNth(t.delimiter)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user