mirror of
https://github.com/Maks1mS/bubbles.git
synced 2024-12-23 14:22:58 +03:00
feat(viewport): line count getters (#283)
This commit is contained in:
parent
0474e129b8
commit
fac7a01329
@ -207,6 +207,16 @@ func (m *Model) LineUp(n int) (lines []string) {
|
|||||||
return m.visibleLines()
|
return m.visibleLines()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TotalLineCount returns the total number of lines (both hidden and visible) within the viewport.
|
||||||
|
func (m Model) TotalLineCount() int {
|
||||||
|
return len(m.lines)
|
||||||
|
}
|
||||||
|
|
||||||
|
// VisibleLineCount returns the number of the visible lines within the viewport.
|
||||||
|
func (m Model) VisibleLineCount() int {
|
||||||
|
return len(m.visibleLines())
|
||||||
|
}
|
||||||
|
|
||||||
// GotoTop sets the viewport to the top position.
|
// GotoTop sets the viewport to the top position.
|
||||||
func (m *Model) GotoTop() (lines []string) {
|
func (m *Model) GotoTop() (lines []string) {
|
||||||
if m.AtTop() {
|
if m.AtTop() {
|
||||||
|
Loading…
Reference in New Issue
Block a user