diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2021-09-14 16:58:26 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2021-09-14 20:36:10 +0900 |
| commit | 0f02fc0c77356a7b72b05131edf6c99d8efa6d33 (patch) | |
| tree | a2eb5c53905e9f7a48dfc4e621fb5d447efec374 /test | |
| parent | 3f90fb42d8871920138ace9878502f22a4d91e85 (diff) | |
| download | fzf-0f02fc0c77356a7b72b05131edf6c99d8efa6d33.tar.gz | |
Reset {n} after reload
Fix #2611
Diffstat (limited to 'test')
| -rwxr-xr-x | test/test_go.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb index 60f14a4b..059e7182 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -2053,6 +2053,22 @@ class TestGoFZF < TestBase tmux.send_keys 'dabcd' tmux.until { |lines| assert_equal '> abcd', lines[-1] } end + + def test_item_index_reset_on_reload + tmux.send_keys "seq 10 | #{FZF} --preview 'echo [[{n}]]' --bind 'up:last,down:first,space:reload:seq 100'", :Enter + tmux.until { |lines| assert_includes lines[1], '[[0]]' } + tmux.send_keys :Up + tmux.until { |lines| assert_includes lines[1], '[[9]]' } + tmux.send_keys :Down + tmux.until { |lines| assert_includes lines[1], '[[0]]' } + tmux.send_keys :Space + tmux.until do |lines| + assert_equal 100, lines.item_count + assert_includes lines[1], '[[0]]' + end + tmux.send_keys :Up + tmux.until { |lines| assert_includes lines[1], '[[99]]' } + end end module TestShell |
