From 928fccc15baf50aafe9ecb50303089361375fb89 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 22 Jul 2015 21:22:59 +0900 Subject: [PATCH] Fix header not shown when the lines go beyond the screen limit --- src/terminal.go | 2 +- test/test_go.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/terminal.go b/src/terminal.go index a5ac33c..c5c9e91 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -388,7 +388,7 @@ func (t *Terminal) printHeader() { line -= 1 } if line >= max { - break + continue } trimmed, colors, newState := extractColor(&lineStr, state) state = newState diff --git a/test/test_go.rb b/test/test_go.rb index 7effb5f..dd113d1 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -680,7 +680,10 @@ class TestGoFZF < TestBase def test_header_lines_overflow 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 assert_equal '', readonce.chomp end