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

Add "eof" action which closes the finder only when input is empty

Close #289
This commit is contained in:
Junegunn Choi
2015-07-22 22:56:53 +09:00
parent b53f61fc59
commit cc0d5539ba
5 changed files with 23 additions and 0 deletions

View File

@@ -718,6 +718,19 @@ class TestGoFZF < TestBase
end
end
def test_eof
tmux.send_keys "seq 100 | #{fzf "--bind 2:eof"}", :Enter
tmux.until { |lines| lines[-2].include?('100/100') }
tmux.send_keys '123'
tmux.until do |lines|
lines[-1] == '> 13' && lines[-2].include?('1/100')
end
tmux.send_keys :BSpace, :BSpace
tmux.until { |lines| lines[-1] == '>' }
tmux.send_keys 2
tmux.prepare
end
private
def writelines path, lines
File.unlink path while File.exists? path