mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-24 15:48:27 +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()
|
maxLines := t.maxItems()
|
||||||
|
|
||||||
// May need to try again after adjusting the offset
|
// 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++ {
|
for tries := 0; tries < maxLines; tries++ {
|
||||||
numItems := maxLines
|
numItems := maxLines
|
||||||
// How many items can be fit on screen including the current item?
|
// How many items can be fit on screen including the current item?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user