Add toggle-header option

Close #3358
This commit is contained in:
Junegunn Choi
2023-07-25 22:11:15 +09:00
parent c0435fdff4
commit f83491274f
5 changed files with 68 additions and 14 deletions

View File

@@ -1213,6 +1213,39 @@ class TestGoFZF < TestBase
end
end
def test_toggle_header
tmux.send_keys "seq 4 | #{FZF} --header-lines 2 --header foo --bind space:toggle-header --header-first --height 10 --border", :Enter
before = <<~OUTPUT
4
> 3
2/2
>
2
1
foo
OUTPUT
tmux.until { assert_block(before, _1) }
tmux.send_keys :Space
after = <<~OUTPUT
4
> 3
2/2
>
OUTPUT
tmux.until { assert_block(after, _1) }
tmux.send_keys :Space
tmux.until { assert_block(before, _1) }
end
def test_cancel
tmux.send_keys "seq 10 | #{fzf('--bind 2:cancel')}", :Enter
tmux.until { |lines| assert_equal ' 10/10', lines[-2] }