forked from tslocum/cview
Add TextDimensions
This commit is contained in:
parent
d776e728ef
commit
c74ebf1471
|
@ -1317,3 +1317,12 @@ func (t *TextView) MouseHandler() func(action MouseAction, event *tcell.EventMou
|
|||
return
|
||||
})
|
||||
}
|
||||
|
||||
// TextDimensions returns the number of lines in the text buffer and the length
|
||||
// of the longest line in the buffer. This is the dimensions of the text buffer.
|
||||
// This is not the dimensions of the TextView on the screen.
|
||||
func (t *TextView) TextDimensions() (int, int) {
|
||||
t.Lock()
|
||||
defer t.Unlock()
|
||||
return t.longestLine, len(t.buffer)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue