From 43f0d0cacde99ba5fdcc32d774cfd8849a6af2b5 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 4 Dec 2021 11:46:15 +0900 Subject: change-preview-window to take multiple option sets separated by '|' So you can "rotate" through the different options with a single binding. fzf --preview 'cat {}' \ --bind 'ctrl-/:change-preview-window(70%|down,40%,border-horizontal|hidden|)' Close #2376 --- test/test_go.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/test_go.rb b/test/test_go.rb index 3fc66f94..95759bfa 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -2191,6 +2191,23 @@ class TestGoFZF < TestBase assert_equal ' 3', lines[1] end end + + def test_change_preview_window_rotate + tmux.send_keys "seq 100 | #{FZF} --preview-window left,border-none --preview 'echo hello' --bind '" \ + "a:change-preview-window(right|down|up|hidden|)'", :Enter + 3.times do + tmux.until { |lines| lines[0].start_with?('hello') } + tmux.send_keys 'a' + tmux.until { |lines| lines[0].end_with?('hello') } + tmux.send_keys 'a' + tmux.until { |lines| lines[-1].start_with?('hello') } + tmux.send_keys 'a' + tmux.until { |lines| assert_equal 'hello', lines[0] } + tmux.send_keys 'a' + tmux.until { |lines| refute_includes lines[0], 'hello' } + tmux.send_keys 'a' + end + end end module TestShell -- cgit v1.2.3