mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-03-13 12:33:43 +03:00
Fix godocs for various types and functions
This commit is contained in:
parent
046b9ca129
commit
a0d7cb77a1
@ -1,4 +1,4 @@
|
||||
// package paginator provides a Bubble Tea package for calulating pagination
|
||||
// Package paginator provides a Bubble Tea package for calulating pagination
|
||||
// and rendering pagination info. Note that this package does not render actual
|
||||
// pages: it's purely for handling keystrokes related to pagination, and
|
||||
// rendering pagination status.
|
||||
@ -91,7 +91,7 @@ func (m *Model) NextPage() {
|
||||
}
|
||||
}
|
||||
|
||||
// LastPage returns whether or not we're on the last page.
|
||||
// OnLastPage returns whether or not we're on the last page.
|
||||
func (m Model) OnLastPage() bool {
|
||||
return m.Page == m.TotalPages-1
|
||||
}
|
||||
|
@ -12,8 +12,7 @@ const (
|
||||
mouseWheelDelta = 3
|
||||
)
|
||||
|
||||
// MODEL
|
||||
|
||||
// Model is the Bubble Tea model for this viewport element.
|
||||
type Model struct {
|
||||
Width int
|
||||
Height int
|
||||
@ -55,7 +54,7 @@ func (m Model) PastBottom() bool {
|
||||
return m.YOffset > len(m.lines)-1-m.Height
|
||||
}
|
||||
|
||||
// Scrollpercent returns the amount scrolled as a float between 0 and 1.
|
||||
// ScrollPercent returns the amount scrolled as a float between 0 and 1.
|
||||
func (m Model) ScrollPercent() float64 {
|
||||
if m.Height >= len(m.lines) {
|
||||
return 1.0
|
||||
@ -218,7 +217,7 @@ func (m *Model) GotoTop() (lines []string) {
|
||||
return lines
|
||||
}
|
||||
|
||||
// GotoTop sets the viewport to the bottom position.
|
||||
// GotoBottom sets the viewport to the bottom position.
|
||||
func (m *Model) GotoBottom() (lines []string) {
|
||||
m.YOffset = max(len(m.lines)-1-m.Height, 0)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user