Skip to content

Commit

Permalink
Fix off-by-one error in viewport's GotoBottom()
Browse files Browse the repository at this point in the history
This was most likely introduced by the fix for rendering final lines in
0ac5ecd.
  • Loading branch information
meowgorithm committed Jan 19, 2022
1 parent 6c015a2 commit 7a6d306
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion viewport/viewport.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 7a6d306

Please sign in to comment.