Add 'wait' action to block fzf until search completion
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled

The 'wait' action blocks subsequent action execution until the current
search completes. This is essential for chaining actions after
query-changing actions (e.g. transform-search(...)+wait+best), ensuring
motion actions operate on complete results rather than stale data.

- Blocks all user input except ESC/CTRL-C while waiting
- Shows visual feedback: dimmed query, (..) indicator, hidden cursor
- Clears pending actions if user cancels with ESC/CTRL-C

Closes: #4825
This commit is contained in:
Junegunn Choi
2026-06-21 22:13:20 +09:00
parent 3c9965a61a
commit eb487035f1
6 changed files with 102 additions and 5 deletions
+8
View File
@@ -1162,6 +1162,14 @@ class TestCore < TestInteractive
tmux.until { |lines| assert_equal 10, lines.match_count }
end
def test_wait_action
tmux.send_keys %((seq 100; sleep 60) | #{FZF} --bind 'start:search(1)+wait+best'), :Enter
tmux.until { |lines| assert_equal 20, lines.match_count }
tmux.until { |lines| assert lines.any_include?('20/100 (..)') }
tmux.send_keys 'C-c'
tmux.until { |lines| refute lines.any_include?('20/100 (..)') }
end
def test_clear_selection
tmux.send_keys %(seq 100 | #{FZF} --multi --bind space:clear-selection), :Enter
tmux.until { |lines| assert_equal 100, lines.match_count }