Skip to content
Myr

Fix a bug where left area on the first line was not always cleared

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 debaf31 · Browse files · 3 files+16 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

3 files+16 added−4 removed

  • other:+16 added−4 removed

3 files+16 added−4 removed

modified:renderer.go+10 added
144 unmodified lines
145 r.mtx.Lock()146 defer r.mtx.Unlock()147148 if r.linesRendered > 0 {149150 // Clear the lines we painted in the last render.151 for i := r.linesRendered; i > 0; i-- {152153 // Check and see if we should skip rendering for this line. That
6 unmodified lines
160 cursorUp(out)161 }162163 if _, exists := r.ignoreLines[0]; !exists {164 // We need to return to the start of the line here to properly165 // erase it. Going back the entire width of the terminal will166 // usually be farther than we need to go, but terminal emulators167 // will stop the cursor at the start of the line as a rule.168 //169 // We use this sequence in particular because it's part of the ANSI170 // standard (whereas others are proprietary to, say, VT100/VT52).171 cursorBack(out, r.width)172173 clearLine(out)174 }175 }176 r.linesRendered = 0
100 unmodified lines
modified:screen.go+4 added
36 unmodified lines
3738func changeScrollingRegion(w io.Writer, top, bottom int) {39 fmt.Fprintf(w, te.CSI+te.ChangeScrollingRegionSeq, top, bottom)40}4142func cursorBack(w io.Writer, n int) {43 fmt.Fprintf(w, te.CSI+te.CursorBackSeq, n)44}
modified:tea.go+2 added-4 removed
195 unmodified lines
196 }197 }198}199200// AltScreen exits the altscreen. This is just a wrapper around the termenv201// function.200// AltScreen enters the alternate screen buffer.201func AltScreen() {202 termenv.AltScreen()203}204206// ExitAltScreen exits the altscreen. This is just a wrapper around the termenv207// function.205// ExitAltScreen exits the alternate screen buffer.206func ExitAltScreen() {207 termenv.ExitAltScreen()208}