summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/terminal.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/terminal.go b/src/terminal.go
index 60cc6f33..7846e662 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -4574,7 +4574,7 @@ func (t *Terminal) constrain() {
maxLines := t.maxItems()
// May need to try again after adjusting the offset
- t.offset = util.Max(0, t.offset) // Prevent -1
+ t.offset = util.Constrain(t.offset, 0, count)
for tries := 0; tries < maxLines; tries++ {
numItems := maxLines
// How many items can be fit on screen including the current item?