Fix line clearing bug

This commit is contained in:
Christian Rocha 2020-06-17 11:49:33 -04:00
parent 090c983bd5
commit ae9ea29c0e
No known key found for this signature in database
GPG Key ID: D6CC7A16E5878018
1 changed files with 6 additions and 1 deletions

View File

@ -148,7 +148,6 @@ func (r *renderer) flush() {
if r.linesRendered > 0 { if r.linesRendered > 0 {
// Clear the lines we painted in the last render. // Clear the lines we painted in the last render.
for i := r.linesRendered; i > 0; i-- { for i := r.linesRendered; i > 0; i-- {
cursorUp(out)
// Check and see if we should skip rendering for this line. That // Check and see if we should skip rendering for this line. That
// includes clearing the line, which we normally do before a // includes clearing the line, which we normally do before a
@ -156,6 +155,12 @@ func (r *renderer) flush() {
if _, exists := r.ignoreLines[i]; !exists { if _, exists := r.ignoreLines[i]; !exists {
clearLine(out) clearLine(out)
} }
cursorUp(out)
}
if _, exists := r.ignoreLines[0]; !exists {
clearLine(out)
} }
} }
r.linesRendered = 0 r.linesRendered = 0