From 2f909886c10e708c9f8900c80e1104f0927984d1 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Fri, 17 Jul 2020 18:13:48 -0400 Subject: [PATCH] Be more consistent with max() argument order --- viewport/viewport.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/viewport/viewport.go b/viewport/viewport.go index 82b4d6c..0aa9015 100644 --- a/viewport/viewport.go +++ b/viewport/viewport.go @@ -168,8 +168,8 @@ func (m *Model) LineDown(n int) (lines []string) { ) if len(m.lines) > 0 { - top := max(0, m.YOffset+m.Height-n) - bottom := min(len(m.lines)-1, m.YOffset+m.Height) + top := max(m.YOffset+m.Height-n, 0) + bottom := min(m.YOffset+m.Height, len(m.lines)-1) lines = m.lines[top:bottom] }