From 0243dff9d3e1845c16c06f71b76dd3e238179da7 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Tue, 16 Jun 2020 14:28:01 -0400 Subject: [PATCH] Remove irrelevant (and erroneous) width settings in viewport renderer --- viewport/renderer.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/viewport/renderer.go b/viewport/renderer.go index 610d846..e4959c5 100644 --- a/viewport/renderer.go +++ b/viewport/renderer.go @@ -11,7 +11,6 @@ type renderer struct { Out io.Writer Y int Height int - TerminalWidth int TerminalHeight int } @@ -48,7 +47,7 @@ func (r *renderer) insertTop(lines []string) { moveTo(r.Out, r.Y, 0) insertLine(r.Out, len(lines)) r.writeLines(lines) - changeScrollingRegion(r.Out, r.TerminalWidth, r.TerminalHeight) + changeScrollingRegion(r.Out, 0, r.TerminalHeight) } // Effectively scroll down. That is, insert a line at the bottom, pushing @@ -57,7 +56,7 @@ func (r *renderer) insertBottom(lines []string) { changeScrollingRegion(r.Out, r.Y, r.Y+r.Height) moveTo(r.Out, r.Y+r.Height, 0) io.WriteString(r.Out, "\r\n"+strings.Join(lines, "\r\n")) - changeScrollingRegion(r.Out, r.TerminalWidth, r.TerminalHeight) + changeScrollingRegion(r.Out, 0, r.TerminalHeight) } // Terminal Control