summaryrefslogtreecommitdiffstats
path: root/test/test_go.rb
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2023-05-05 15:08:08 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2023-05-05 15:33:03 +0900
commit94999101e358385f3ca67a6ec9512f549196b802 (patch)
tree1b2bab23c86aeaa4aaaceb95396e22a113e2c7f7 /test/test_go.rb
parente619b7c4f4e0da09b87a239b8f52ad909bb5f1e0 (diff)
Fix the behavior of change-preview-window action (#3280)
* change-preview-window restores the initial preview window options, and overrides the properties that are specified * However, 'hidden' property is treated differently. It is set to 'false' if the specified properties of the action is non-empty. * cf. toggle-preview takes the "current" preview window options and toggles the 'hidden' property.
Diffstat (limited to 'test/test_go.rb')
-rwxr-xr-xtest/test_go.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 1c5c3de4..3a768744 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -2493,6 +2493,39 @@ class TestGoFZF < TestBase
end
end
+ def test_change_preview_window_rotate_hidden
+ tmux.send_keys "seq 100 | #{FZF} --preview-window hidden --preview 'echo =={}==' --bind '" \
+ "a:change-preview-window(nohidden||down,1|)'", :Enter
+ tmux.until { |lines| assert_equal 100, lines.match_count }
+ tmux.until { |lines| refute_includes lines[1], '==1==' }
+ tmux.send_keys 'a'
+ tmux.until { |lines| assert_includes lines[1], '==1==' }
+ tmux.send_keys 'a'
+ tmux.until { |lines| refute_includes lines[1], '==1==' }
+ tmux.send_keys 'a'
+ tmux.until { |lines| assert_includes lines[-2], '==1==' }
+ tmux.send_keys 'a'
+ tmux.until { |lines| refute_includes lines[-2], '==1==' }
+ tmux.send_keys 'a'
+ tmux.until { |lines| assert_includes lines[1], '==1==' }
+ end
+
+ def test_change_preview_window_rotate_hidden_down
+ tmux.send_keys "seq 100 | #{FZF} --bind '?:change-preview-window:up||down|' --preview 'echo =={}==' --preview-window hidden,down,1", :Enter
+ tmux.until { |lines| assert_equal 100, lines.match_count }
+ tmux.until { |lines| refute_includes lines[1], '==1==' }
+ tmux.send_keys '?'
+ tmux.until { |lines| assert_includes lines[1], '==1==' }
+ tmux.send_keys '?'
+ tmux.until { |lines| refute_includes lines[1], '==1==' }
+ tmux.send_keys '?'
+ tmux.until { |lines| assert_includes lines[-2], '==1==' }
+ tmux.send_keys '?'
+ tmux.until { |lines| refute_includes lines[-2], '==1==' }
+ tmux.send_keys '?'
+ tmux.until { |lines| assert_includes lines[1], '==1==' }
+ end
+
def test_ellipsis
tmux.send_keys 'seq 1000 | tr "\n" , | fzf --ellipsis=SNIPSNIP -e -q500', :Enter
tmux.until { |lines| assert_equal 1, lines.match_count }