From 7a6d30688968415a3ad1604e97ed50d5b8714c97 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Tue, 18 Jan 2022 12:18:50 -0500 Subject: [PATCH] Fix off-by-one error in viewport's GotoBottom() This was most likely introduced by the fix for rendering final lines in 0ac5ecdf8170df53c057b079cca315ac77c31d16. --- viewport/viewport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/viewport/viewport.go b/viewport/viewport.go index ee89208..f40ed76 100644 --- a/viewport/viewport.go +++ b/viewport/viewport.go @@ -213,7 +213,7 @@ func (m *Model) GotoTop() (lines []string) { // GotoBottom sets the viewport to the bottom position. func (m *Model) GotoBottom() (lines []string) { - m.SetYOffset(len(m.lines) - 1 - m.Height) + m.SetYOffset(len(m.lines) - m.Height) return m.visibleLines() }