diff --git a/src/terminal.go b/src/terminal.go index 60cc6f3..7846e66 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?