mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
Correct "scroll down" behavior
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user