From c3eeb5c8affecc08b43fa18204b5025dc2c0e72d Mon Sep 17 00:00:00 2001 From: Syohei YOSHIDA Date: Sat, 3 Oct 2015 10:13:19 +0900 Subject: [PATCH] Don't change line if there is no output --- layout.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout.go b/layout.go index ca29386..7b4bb8f 100644 --- a/layout.go +++ b/layout.go @@ -351,7 +351,7 @@ func (l *ListArea) Draw(parent Layout, perPage int, runningQuery bool) { // This protects us from losing the selected line in case our selected // line is greater than the buffer - if lbufsiz := linebuf.Size(); l.currentLine >= lbufsiz { + if lbufsiz := linebuf.Size(); lbufsiz > 0 && l.currentLine >= lbufsiz { l.currentLine = lbufsiz - 1 }