m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Implement bindable "change" event and "top" action

# Move cursor to the top result whenever the query string is changed
    fzf --bind change:top

Close #925
This commit is contained in:
Junegunn Choi
2017-05-22 17:07:05 +09:00
parent 3a5086796d
commit e1e3339770
5 changed files with 35 additions and 0 deletions

View File

@@ -1304,6 +1304,20 @@ class TestGoFZF < TestBase
tmux.send_keys :Enter
tmux.until { |lines| lines[-2] == prompt && lines[-1] == '1' }
end
def test_change_top
tmux.send_keys %[seq 1000 | #{FZF} --bind change:top], :Enter
tmux.until { |lines| lines.match_count == 1000 }
tmux.send_keys :Up
tmux.until { |lines| lines[-4] == '> 2' }
tmux.send_keys 1
tmux.until { |lines| lines[-3] == '> 1' }
tmux.send_keys :Up
tmux.until { |lines| lines[-4] == '> 10' }
tmux.send_keys 1
tmux.until { |lines| lines[-3] == '> 11' }
tmux.send_keys :Enter
end
end
module TestShell