Skip to content
Myr

Add command to sync scrollable area with renderer

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

This is necessary for initial paints, and probably for resizes.

authored by Christian Rocha · committed by Christian Rocha · parent 83e41c1 · Browse files · 1 file+20 added−4 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+20 added−4 removed

  • other:+20 added−4 removed

1 file+20 added−4 removed

modified:renderer.go+20 added-4 removed
257 unmodified lines
258259 case clearIgnoredLinesMsg:260 r.clearIgnoredLines()261262 case syncScrollAreaMsg:263 r.setIgnoredLines(msg.topBoundary, msg.bottomBoundary)264 r.insertTop(msg.lines, msg.topBoundary, msg.bottomBoundary)265266 case scrollUpMsg:267 r.insertTop(msg.lines, msg.topBoundary, msg.bottomBoundary)268269 case scrollDownMsg:
42 unmodified lines
312func ClearIgnoredLines() Msg {313 return clearIgnoredLinesMsg{}314}315312// scrollDownMsg is experiemental. There are no guarantees about it persisting313// in a future API. It's exposed for high performance scrolling.316type scrollUpMsg struct {317 lines []string318 topBoundary int319 bottomBoundary int
8 unmodified lines
328 }329 }330}331330// scrollDownMsg is experiemental. There are no guarantees about it persisting331// in a future API. It's exposed for high performance scrolling.332type scrollDownMsg struct {333 lines []string334 topBoundary int335 bottomBoundary int
7 unmodified lines
343 bottomBoundary: bottomBoundary,344 }345 }346}347348type syncScrollAreaMsg struct {349 lines []string350 topBoundary int351 bottomBoundary int352}353354func SyncScrollArea(lines []string, topBoundary int, bottomBoundary int) Cmd {355 return func() Msg {356 return syncScrollAreaMsg{357 lines: lines,358 topBoundary: topBoundary,359 bottomBoundary: bottomBoundary,360 }361 }362}