mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-01 05:30:30 +08:00
Run bg-transform callbacks during wait instead of dropping them
Wait-block guard returned early for all actions but abort/cancel, silently discarding actAsync so bg-transform results completing mid-wait were lost. Let actAsync through since it's unrelated to the wait.
This commit is contained in:
@@ -1185,6 +1185,15 @@ class TestCore < TestInteractive
|
||||
tmux.until { |lines| assert_equal 1, lines.match_count }
|
||||
end
|
||||
|
||||
def test_wait_action_bg_transform
|
||||
# A bg-transform result is unrelated to the wait, so it's applied while the
|
||||
# wait is still blocking rather than dropped. The long read keeps the wait
|
||||
# blocked so the (instant) bg-transform completes during the block; the
|
||||
# header must show while '(..)' is still displayed.
|
||||
tmux.send_keys %((seq 100; sleep 2) | #{FZF} --bind 'start:bg-transform-header(echo hello)+search(5)+wait'), :Enter
|
||||
tmux.until { |lines| assert(lines.any_include?('(..)') && lines.any_include?('hello')) }
|
||||
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 }
|
||||
|
||||
Reference in New Issue
Block a user