diff --git a/renderer.go b/renderer.go index 9deab8f..6c472dc 100644 --- a/renderer.go +++ b/renderer.go @@ -215,6 +215,9 @@ func (r *renderer) insertTop(lines []string, topBoundary, bottomBoundary int) { _, _ = io.WriteString(b, strings.Join(lines, "\r\n")) changeScrollingRegion(b, 0, r.height) + // Move cursor back to where the main rendering routine expects it to be + moveCursor(b, r.linesRendered, 0) + r.out.Write(b.Bytes()) } @@ -238,6 +241,9 @@ func (r *renderer) insertBottom(lines []string, topBoundary, bottomBoundary int) _, _ = io.WriteString(b, "\r\n"+strings.Join(lines, "\r\n")) changeScrollingRegion(b, 0, r.height) + // Move cursor back to where the main rendering routine expects it to be + moveCursor(b, r.linesRendered, 0) + r.out.Write(b.Bytes()) }