summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/terminal.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/terminal.go b/src/terminal.go
index dd3590c4..2bd12f71 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -4468,13 +4468,16 @@ func (t *Terminal) Loop() error {
}
}
- for ; linesToMove > 0; linesToMove-- {
- cy := t.cy
+ for i := 0; i < linesToMove; i++ {
+ cy, offset := t.cy, t.offset
t.vset(cy + direction)
t.constrain()
- if cy == t.cy ||
- direction > 0 && t.offset >= maxOffset ||
- direction < 0 && t.offset <= minOffset {
+ if cy == t.cy {
+ break
+ }
+ if i > 0 && (direction > 0 && t.offset > maxOffset ||
+ direction < 0 && t.offset < minOffset) {
+ t.cy, t.offset = cy, offset
break
}
}