From 3c07b97d37e6d99328021c24977316594d3ae868 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Fri, 17 Jul 2020 17:02:37 -0400 Subject: [PATCH] Correct typo, add potential TODO --- viewport/viewport.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/viewport/viewport.go b/viewport/viewport.go index 86172a5..0baa6d3 100644 --- a/viewport/viewport.go +++ b/viewport/viewport.go @@ -156,7 +156,7 @@ func (m *Model) HalfViewUp() (lines []string) { return lines } -// LineDown moves the view up by the given number of lines. +// LineDown moves the view down by the given number of lines. func (m *Model) LineDown(n int) (lines []string) { if m.AtBottom() || n == 0 { return nil @@ -206,6 +206,8 @@ func Sync(m Model) tea.Cmd { return nil } + // TODO: we should probably use m.visibleLines() rather than these two + // expressions. top := max(m.YOffset, 0) bottom := min(m.YOffset+m.Height, len(m.lines)-1)