From 634dc4d8201b8d808958960b1a04d23d6b1e37a5 Mon Sep 17 00:00:00 2001 From: Leo Robinovitch Date: Thu, 30 Jun 2022 18:42:23 -0700 Subject: [PATCH] Fix bug where overflow if viewport height matches terminal height exactly --- internal/tui/components/viewport/viewport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/tui/components/viewport/viewport.go b/internal/tui/components/viewport/viewport.go index cfc8b0f0..ca56e09b 100644 --- a/internal/tui/components/viewport/viewport.go +++ b/internal/tui/components/viewport/viewport.go @@ -604,7 +604,7 @@ func (m Model) getFooter() (string, int) { denominator = totalNumLines } - if totalNumLines > m.height-len(m.getHeader()) { + if totalNumLines >= m.height-len(m.getHeader()) { percentScrolled := percent(numerator, denominator) footerString := fmt.Sprintf("%d%% (%d/%d)", percentScrolled, numerator, denominator) renderedFooterString := m.FooterStyle.Copy().MaxWidth(m.width).Render(footerString)