From 6d0eae1f0b9d2d74e4ada27265d309a3c447b681 Mon Sep 17 00:00:00 2001 From: Brian Mattern Date: Mon, 3 Jun 2019 15:18:40 -0700 Subject: [PATCH] Fix counter when list has 0 items. --- src/termui/table.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/termui/table.go b/src/termui/table.go index eeb82af..e587839 100644 --- a/src/termui/table.go +++ b/src/termui/table.go @@ -131,6 +131,9 @@ func (self *Table) Draw(buf *Buffer) { func (self *Table) drawLocation(buf *Buffer) { total := len(self.Rows) topRow := self.TopRow + 1 + if topRow > total { + topRow = total + } bottomRow := self.TopRow + self.Inner.Dy() - 1 if bottomRow > total { bottomRow = total