diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-03-26 10:34:52 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-03-26 10:34:52 +0900 |
| commit | 4a0ab6c9267ef9e07723c3c19f9007d7ed3ea9b4 (patch) | |
| tree | d042d84e613599d2c529665fd2e0cdaf99d1416b /test | |
| parent | f43e82f17fb107d2093e6226833eb68e532c1810 (diff) | |
| download | fzf-4a0ab6c9267ef9e07723c3c19f9007d7ed3ea9b4.tar.gz | |
Improve query modification prevention in input-less mode
fzf would restore the original query in input-less mode after executing
a chain of actions.
This commit changes the behavior so that the restoration
happens after each action to allow something like
'show-input+change-query(...)+hide-input'.
Fix #4326
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_core.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_core.rb b/test/test_core.rb index ade644a2..d37a4b47 100644 --- a/test/test_core.rb +++ b/test/test_core.rb @@ -1866,4 +1866,19 @@ class TestCore < TestInteractive assert_includes lines, '> 555' end end + + def test_no_input_change_query + tmux.send_keys %(seq 1000 | #{FZF} --multi --query 999 --no-input --bind 'enter:show-input+change-query(555)+hide-input,space:change-query(555)+select'), :Enter + tmux.until { |lines| assert_includes lines, '> 999' } + tmux.send_keys :Space + tmux.until do |lines| + assert_includes lines, '>>999' + refute_includes lines, '> 555' + end + tmux.send_keys :Enter + tmux.until do |lines| + refute_includes lines, '>>999' + assert_includes lines, '> 555' + end + end end |
