vendor: github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531

full diff: 8066bb9726...f9a4f7ef65

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2023-07-17 10:40:40 +02:00
parent ff2c8da803
commit 2666bd6996
4 changed files with 15 additions and 4 deletions

View File

@ -181,6 +181,13 @@ func (v *VT100) UsedHeight() int {
}
func (v *VT100) Resize(y, x int) {
// add some minimal defaults to handle zero and negative values
if x < 6 {
x = 6
}
if y < 1 {
y = 1
}
if y > v.Height {
n := y - v.Height
for row := 0; row < n; row++ {
@ -329,6 +336,10 @@ func (v *VT100) advance() {
}
func (v *VT100) scrollIfNeeded() {
if v.Cursor.X >= v.Width {
v.Cursor.X = 0
v.Cursor.Y++
}
if v.Cursor.Y >= v.Height {
first := v.Content[0]
copy(v.Content, v.Content[1:])