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

Allow invisible preview window (--preview-window 0)

Close #820
This commit is contained in:
Junegunn Choi
2017-01-24 00:23:16 +09:00
parent a3244c4892
commit 6a75e30941
5 changed files with 38 additions and 14 deletions

View File

@@ -1224,6 +1224,19 @@ class TestGoFZF < TestBase
tmux.send_keys '?'
tmux.until { |lines| lines[-1] == '> 555' }
end
def test_preview_size_0
File.unlink tempname rescue nil
tmux.send_keys %[seq 100 | #{FZF} --reverse --preview 'echo {} >> #{tempname}; echo ' --preview-window 0], :Enter
tmux.until { |lines| lines.item_count == 100 && lines[1] == ' 100/100' && lines[2] == '> 1' }
tmux.until { |_| %w[1] == File.readlines(tempname).map(&:chomp) }
tmux.send_keys :Down
tmux.until { |lines| lines[3] == '> 2' }
tmux.until { |_| %w[1 2] == File.readlines(tempname).map(&:chomp) }
tmux.send_keys :Down
tmux.until { |lines| lines[4] == '> 3' }
tmux.until { |_| %w[1 2 3] == File.readlines(tempname).map(&:chomp) }
end
end
module TestShell