mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-03-13 20:43:44 +03:00
Remove irrelevant (and erroneous) width settings in viewport renderer
This commit is contained in:
parent
68ec6c7ffc
commit
0243dff9d3
@ -11,7 +11,6 @@ type renderer struct {
|
|||||||
Out io.Writer
|
Out io.Writer
|
||||||
Y int
|
Y int
|
||||||
Height int
|
Height int
|
||||||
TerminalWidth int
|
|
||||||
TerminalHeight int
|
TerminalHeight int
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +47,7 @@ func (r *renderer) insertTop(lines []string) {
|
|||||||
moveTo(r.Out, r.Y, 0)
|
moveTo(r.Out, r.Y, 0)
|
||||||
insertLine(r.Out, len(lines))
|
insertLine(r.Out, len(lines))
|
||||||
r.writeLines(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
|
// 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)
|
changeScrollingRegion(r.Out, r.Y, r.Y+r.Height)
|
||||||
moveTo(r.Out, r.Y+r.Height, 0)
|
moveTo(r.Out, r.Y+r.Height, 0)
|
||||||
io.WriteString(r.Out, "\r\n"+strings.Join(lines, "\r\n"))
|
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
|
// Terminal Control
|
||||||
|
Loading…
Reference in New Issue
Block a user