forked from Mirrors/bubbletea
Fix infinte loop + backwards ignore behavior
This commit is contained in:
parent
683473c26d
commit
b72009105b
|
@ -147,7 +147,7 @@ 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-- {
|
||||||
// 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
|
||||||
// render.
|
// render.
|
||||||
|
@ -160,7 +160,7 @@ func (r *renderer) flush() {
|
||||||
r.linesRendered = 0
|
r.linesRendered = 0
|
||||||
|
|
||||||
for _, b := range r.buf.Bytes() {
|
for _, b := range r.buf.Bytes() {
|
||||||
if _, exists := r.ignoreLines[r.linesRendered]; !exists {
|
if _, exists := r.ignoreLines[r.linesRendered]; exists {
|
||||||
cursorDown(out) // skip rendering for this line.
|
cursorDown(out) // skip rendering for this line.
|
||||||
r.linesRendered++
|
r.linesRendered++
|
||||||
} else if b == '\n' {
|
} else if b == '\n' {
|
||||||
|
|
Loading…
Reference in New Issue