forked from Mirrors/bubbletea
Put cursor back where we found it after scrolling
This commit is contained in:
parent
eff99294e1
commit
ebbab2908c
|
@ -215,6 +215,9 @@ func (r *renderer) insertTop(lines []string, topBoundary, bottomBoundary int) {
|
||||||
_, _ = io.WriteString(b, strings.Join(lines, "\r\n"))
|
_, _ = io.WriteString(b, strings.Join(lines, "\r\n"))
|
||||||
changeScrollingRegion(b, 0, r.height)
|
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())
|
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"))
|
_, _ = io.WriteString(b, "\r\n"+strings.Join(lines, "\r\n"))
|
||||||
changeScrollingRegion(b, 0, r.height)
|
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())
|
r.out.Write(b.Bytes())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue