Skip to content
Myr

fix: pendingErase in cursedRenderer (#1755)

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

authored by Drew Smirnoff · committed by GitHub · parent 351d215 · Browse files · 1 file+5 added−1 removed
This commit

State

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

Trailers

  • Signed-off-by: drew <me@andrinoff.com>

Diff stats

1 file+5 added−1 removed

  • other:+5 added−1 removed

1 file+5 added−1 removed

modified:cursed_renderer.go+5 added-1 removed
31 unmodified lines
32 backspace bool // whether to use backspace to optimize cursor movements33 mapnl bool34 syncdUpdates bool // whether to use synchronized output mode for updates35 starting bool // indicates whether the renderer is starting after being stopped36 pendingErase bool // an scr.Erase() is pending and hasn't been drained by flush yet37}3839var _ renderer = &cursedRenderer{}40
243 unmodified lines
284 if s.starting && s.hardTabs {285 _, _ = s.scr.WriteString(ansi.SetTabEvery8Columns)286 }287287 if !s.starting && !closing && s.lastView != nil && viewEquals(s.lastView, &view) && frameArea == s.cellbuf.Bounds() {288 if !s.starting && !closing && !s.pendingErase && s.lastView != nil && viewEquals(s.lastView, &view) && frameArea == s.cellbuf.Bounds() {289 // No changes, nothing to do.290 return nil291 }292293 // We're no longer starting.294 s.starting = false295 s.pendingErase = false296297 if frameArea != s.cellbuf.Bounds() {298 s.scr.Erase() // Force a full redraw to avoid artifacts.299
328 unmodified lines
628 // would scroll the screen and our content would be lost.629 s.scr.Erase()630 s.width, s.height = w, h631 s.scr.Resize(s.width, s.height)632 s.pendingErase = true633 s.mu.Unlock()634}635636// clearScreen implements renderer.
2 unmodified lines
639 // Move the cursor to the top left corner of the screen and trigger a full640 // screen redraw.641 s.scr.MoveTo(0, 0)642 s.scr.Erase()643 s.pendingErase = true644 s.mu.Unlock()645}646647// enableAltScreen sets the alt screen mode.
217 unmodified lines