Skip to content
Myr

Create ignoreLines map on demand

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 9022251 · Browse files · 1 file+5 added−3 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+5 added−3 removed

  • other:+5 added−3 removed

1 file+5 added−3 removed

modified:renderer.go+5 added-3 removed
165 unmodified lines
166167// setIngoredLines speicifies lines not to be touched by the standard Bubble Tea168// renderer.169func (r *renderer) setIgnoredLines(from int, to int) {170 if r.ignoreLines == nil {171 r.ignoreLines = make(map[int]struct{})172 }173 for i := from; i < to; i++ {174 r.ignoreLines[i] = struct{}{}175 }176}
1 unmodified line
178// clearIgnoredLines sets all lines to be rendered by the standard Bubble179// Tea renderer. Any lines previously set to be ignored can be rendered to180// again.181func (r *renderer) clearIgnoredLines() {179 r.ignoreLines = make(map[int]struct{})182 r.ignoreLines = nil183}184185// insertTop effectively scrolls up. It inserts lines at the top of a given186// area designated to be a scrollable region, pushing everything else down.
54 unmodified lines
241242 r.out.Write(b.Bytes())243}244242// handleMessages handles internal messages for the renderer. It belongs in the243// main update loop at the program level.245// handleMessages handles internal messages for the renderer.246func (r *renderer) handleMessages(msg Msg) {247 switch msg := msg.(type) {248 case WindowSizeMsg:249 r.width = msg.Width
97 unmodified lines