Correct "scroll down" behavior

This commit is contained in:
Christian Rocha 2020-06-17 20:24:43 -04:00
parent 2110a923ab
commit 902225116c
No known key found for this signature in database
GPG Key ID: D6CC7A16E5878018
1 changed files with 2 additions and 2 deletions

View File

@ -231,7 +231,7 @@ func (r *renderer) insertBottom(lines []string, topBoundary, bottomBoundary int)
saveCursorPosition(b) saveCursorPosition(b)
changeScrollingRegion(b, topBoundary, bottomBoundary) changeScrollingRegion(b, topBoundary, bottomBoundary)
moveCursor(b, topBoundary, 0) moveCursor(b, bottomBoundary, 0)
_, _ = io.WriteString(b, "\r\n"+strings.Join(lines, "\r\n")) _, _ = io.WriteString(b, "\r\n"+strings.Join(lines, "\r\n"))
changeScrollingRegion(b, 0, r.height) changeScrollingRegion(b, 0, r.height)
restoreCursorPosition(b) restoreCursorPosition(b)
@ -261,7 +261,7 @@ func (r *renderer) handleMessages(msg Msg) {
r.insertTop(msg.lines, msg.topBoundary, msg.bottomBoundary) r.insertTop(msg.lines, msg.topBoundary, msg.bottomBoundary)
case scrollDownMsg: case scrollDownMsg:
r.insertTop(msg.lines, msg.topBoundary, msg.bottomBoundary) r.insertBottom(msg.lines, msg.topBoundary, msg.bottomBoundary)
} }
} }