mirror of https://github.com/rivo/tview.git
Merge pull request #30 from maja42/TextViewScrolling
Thanks. I will make some modifications to this. You might want to check them out.
This commit is contained in:
commit
f26cdc84a2
15
textview.go
15
textview.go
|
@ -286,6 +286,21 @@ func (t *TextView) SetDoneFunc(handler func(key tcell.Key)) *TextView {
|
|||
return t
|
||||
}
|
||||
|
||||
// ScrollToBeginning scrolls to the top left corner of the text.
|
||||
func (t *TextView) ScrollToBeginning() *TextView {
|
||||
t.trackEnd = false
|
||||
t.lineOffset = 0
|
||||
t.columnOffset = 0
|
||||
return t
|
||||
}
|
||||
|
||||
// ScrollToEnd scrolls to the bottom left corner of the text.
|
||||
func (t *TextView) ScrollToEnd() *TextView {
|
||||
t.trackEnd = true
|
||||
t.columnOffset = 0
|
||||
return t
|
||||
}
|
||||
|
||||
// Clear removes all text from the buffer.
|
||||
func (t *TextView) Clear() *TextView {
|
||||
t.buffer = nil
|
||||
|
|
Loading…
Reference in New Issue