From ae9ea29c0ed458f212d4703751819603ecc086dc Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 17 Jun 2020 11:49:33 -0400 Subject: [PATCH] Fix line clearing bug --- renderer.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/renderer.go b/renderer.go index 8473376..226e7e9 100644 --- a/renderer.go +++ b/renderer.go @@ -148,7 +148,6 @@ func (r *renderer) flush() { if r.linesRendered > 0 { // Clear the lines we painted in the last render. for i := r.linesRendered; i > 0; i-- { - cursorUp(out) // Check and see if we should skip rendering for this line. That // includes clearing the line, which we normally do before a @@ -156,6 +155,12 @@ func (r *renderer) flush() { if _, exists := r.ignoreLines[i]; !exists { clearLine(out) } + + cursorUp(out) + } + + if _, exists := r.ignoreLines[0]; !exists { + clearLine(out) } } r.linesRendered = 0