From 4a0ab6c9267ef9e07723c3c19f9007d7ed3ea9b4 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 26 Mar 2025 10:34:52 +0900 Subject: 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 --- test/test_core.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/test_core.rb') 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 -- cgit v1.2.3