Fix header not shown when the lines go beyond the screen limit

This commit is contained in:
Junegunn Choi 2015-07-22 21:22:59 +09:00
parent bbaa3ab8bd
commit 928fccc15b
2 changed files with 5 additions and 2 deletions

View File

@ -388,7 +388,7 @@ func (t *Terminal) printHeader() {
line -= 1 line -= 1
} }
if line >= max { if line >= max {
break continue
} }
trimmed, colors, newState := extractColor(&lineStr, state) trimmed, colors, newState := extractColor(&lineStr, state)
state = newState state = newState

View File

@ -680,7 +680,10 @@ class TestGoFZF < TestBase
def test_header_lines_overflow def test_header_lines_overflow
tmux.send_keys "seq 100 | #{fzf '--header-lines=200'}", :Enter tmux.send_keys "seq 100 | #{fzf '--header-lines=200'}", :Enter
tmux.until { |lines| lines[-2].include?('0/0') } tmux.until do |lines|
lines[-2].include?('0/0') &&
lines[-3].include?(' 1')
end
tmux.send_keys :Enter tmux.send_keys :Enter
assert_equal '', readonce.chomp assert_equal '', readonce.chomp
end end