summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-03-26 10:34:52 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-03-26 10:34:52 +0900
commit4a0ab6c9267ef9e07723c3c19f9007d7ed3ea9b4 (patch)
treed042d84e613599d2c529665fd2e0cdaf99d1416b /test
parentf43e82f17fb107d2093e6226833eb68e532c1810 (diff)
downloadfzf-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.rb15
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