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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user