Fix offset-up and offset-down with --layout=reverse (#3456)

This commit is contained in:
Junegunn Choi 2023-10-12 19:14:03 +09:00
parent a8f9432a3a
commit 3df06a1c68
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -3411,11 +3411,17 @@ func (t *Terminal) Loop() {
if a.t == actOffsetDown { if a.t == actOffsetDown {
diff = -1 diff = -1
} }
if t.layout == layoutReverse {
diff *= -1
}
t.offset += diff t.offset += diff
before := t.offset before := t.offset
t.constrain() t.constrain()
if before != t.offset { if before != t.offset {
t.offset = before t.offset = before
if t.layout == layoutReverse {
diff *= -1
}
t.vmove(diff, false) t.vmove(diff, false)
} }
req(reqList) req(reqList)