Fix (half-)page-up/down in the presence of multi-line items

Fix #4069
This commit is contained in:
Junegunn Choi 2024-11-07 22:21:07 +09:00
parent d4d9b99879
commit 4a85843bcf
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -4422,6 +4422,7 @@ func (t *Terminal) Loop() error {
direction = 1
}
moved := false
for linesToMove > 0 {
currentItem := t.currentItem()
if currentItem == nil {
@ -4430,11 +4431,15 @@ func (t *Terminal) Loop() error {
itemLines, _ := t.numItemLines(currentItem, maxItems)
linesToMove -= itemLines
if moved && linesToMove < 0 {
break
}
cy := t.cy
t.vmove(direction, false)
if cy == t.cy {
break
}
moved = true
}
req(reqList)
case actOffsetUp, actOffsetDown: