From 49b496269c52497cfbd21952c9b8c7a426d1632d Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 30 May 2024 11:03:36 +0900 Subject: [PATCH] Fix index out of bounds error on scroll-down action --- src/terminal.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/terminal.go b/src/terminal.go index d5ad72a5..0e945fad 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -4550,6 +4550,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 for tries := 0; tries < maxLines; tries++ { numItems := maxLines // How many items can be fit on screen including the current item?