From 902225116c2ea399fb9f0ec3e914f612c5c9ebb7 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 17 Jun 2020 20:24:43 -0400 Subject: [PATCH] Correct "scroll down" behavior --- renderer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renderer.go b/renderer.go index 2bb2065..4c9af9d 100644 --- a/renderer.go +++ b/renderer.go @@ -231,7 +231,7 @@ func (r *renderer) insertBottom(lines []string, topBoundary, bottomBoundary int) saveCursorPosition(b) changeScrollingRegion(b, topBoundary, bottomBoundary) - moveCursor(b, topBoundary, 0) + moveCursor(b, bottomBoundary, 0) _, _ = io.WriteString(b, "\r\n"+strings.Join(lines, "\r\n")) changeScrollingRegion(b, 0, r.height) restoreCursorPosition(b) @@ -261,7 +261,7 @@ func (r *renderer) handleMessages(msg Msg) { r.insertTop(msg.lines, msg.topBoundary, msg.bottomBoundary) case scrollDownMsg: - r.insertTop(msg.lines, msg.topBoundary, msg.bottomBoundary) + r.insertBottom(msg.lines, msg.topBoundary, msg.bottomBoundary) } }