summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbitraid <bitraid@protonmail.ch>2025-02-25 17:18:56 +0200
committerGitHub <noreply@github.com>2025-02-26 00:18:56 +0900
commitbb64d84ce407221bd0c4e219b182cfbafac0bed7 (patch)
tree9ce047d31f8a1079365c34f79d18b55364c045c9 /test
parentcd1da27ff2df2ba2927db5b1ef8d8127e8e60800 (diff)
downloadfzf-bb64d84ce407221bd0c4e219b182cfbafac0bed7.tar.gz
[fish] Enable multiple history commands insertion (#4280)
Enable inserting multiple history commands. To disable, set `--no-multi` through `$FZF_CTRL_R_OPTS`. Also, remove the usage of `become` action, to avoid leaving behind temporary files. Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_shell_integration.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test_shell_integration.rb b/test/test_shell_integration.rb
index 4c38b76b..239dc258 100644
--- a/test/test_shell_integration.rb
+++ b/test/test_shell_integration.rb
@@ -482,4 +482,36 @@ class TestFish < TestBase
tmux.send_keys "set -g #{name} '#{val}'", :Enter
tmux.prepare
end
+
+ def test_ctrl_r_multi
+ tmux.send_keys ':', :Enter
+ tmux.send_keys 'echo "foo', :Enter, 'bar"', :Enter
+ tmux.prepare
+ tmux.send_keys 'echo "bar', :Enter, 'foo"', :Enter
+ tmux.prepare
+ tmux.send_keys 'C-l', 'C-r'
+ block = <<~BLOCK
+ echo "foo
+ bar"
+ echo "bar
+ foo"
+ BLOCK
+ tmux.until do |lines|
+ block.lines.each_with_index do |line, idx|
+ assert_includes lines[-6 + idx], line.chomp
+ end
+ end
+ tmux.send_keys :BTab, :BTab
+ tmux.until { |lines| assert_includes lines[-2], '(2)' }
+ tmux.send_keys :Enter
+ block = <<~BLOCK
+ echo "bar
+ foo"
+ echo "foo
+ bar"
+ BLOCK
+ tmux.until do |lines|
+ assert_equal block.lines.map(&:chomp), lines
+ end
+ end
end