diff --git a/paginator/paginator.go b/paginator/paginator.go index 73df938..51630d7 100644 --- a/paginator/paginator.go +++ b/paginator/paginator.go @@ -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 } diff --git a/viewport/viewport.go b/viewport/viewport.go index 2b2f180..b3a7ffa 100644 --- a/viewport/viewport.go +++ b/viewport/viewport.go @@ -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)