From cbec2ff0825cf683bf87732e1331009c641f7a99 Mon Sep 17 00:00:00 2001 From: Daisuke Maki Date: Mon, 28 Sep 2015 21:31:54 +0900 Subject: [PATCH] Compare against linbuf, not cropped buffer fixes #264 --- layout.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout.go b/layout.go index c4cf41a..dfe4705 100644 --- a/layout.go +++ b/layout.go @@ -409,8 +409,8 @@ 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 l.currentLine >= bufsiz { - l.currentLine = bufsiz - 1 + if lbufsiz := linebuf.Size(); l.currentLine >= lbufsiz { + l.currentLine = lbufsiz - 1 } // previously drawn lines are cached. first, truncate the cache