mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-08 17:24:05 +00:00
Fix index out of bounds error caused by outdated offset
This commit is contained in:
parent
dc73fba188
commit
1616ed543d
@ -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?
|
||||
|
Loading…
Reference in New Issue
Block a user