Skip to content
Myr

Correct "scroll down" behavior

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent 2110a92 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:renderer.go+2 added-2 removed
229 unmodified lines
230 b := new(bytes.Buffer)231232 saveCursorPosition(b)233 changeScrollingRegion(b, topBoundary, bottomBoundary)234 moveCursor(b, topBoundary, 0)234 moveCursor(b, bottomBoundary, 0)235 _, _ = io.WriteString(b, "\r\n"+strings.Join(lines, "\r\n"))236 changeScrollingRegion(b, 0, r.height)237 restoreCursorPosition(b)238
21 unmodified lines
260 case scrollUpMsg:261 r.insertTop(msg.lines, msg.topBoundary, msg.bottomBoundary)262263 case scrollDownMsg:264 r.insertTop(msg.lines, msg.topBoundary, msg.bottomBoundary)264 r.insertBottom(msg.lines, msg.topBoundary, msg.bottomBoundary)265 }266}267268// HIGH-PERFORMANCE RENDERING STUFF
76 unmodified lines