Skip to content
Myr

Fix index out of bounds error caused by outdated offset

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent dc73fba · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:src/terminal.go+1 added-1 removed
4572 unmodified lines
4573 count := t.merger.Length()4574 maxLines := t.maxItems()45754576 // May need to try again after adjusting the offset4577 t.offset = util.Max(0, t.offset) // Prevent -14577 t.offset = util.Constrain(t.offset, 0, count)4578 for tries := 0; tries < maxLines; tries++ {4579 numItems := maxLines4580 // How many items can be fit on screen including the current item?4581 if t.multiLine && t.merger.Length() > 0 {
161 unmodified lines