diff --git a/bubbles.go b/bubbles.go index 9b9e8d4..52af450 100644 --- a/bubbles.go +++ b/bubbles.go @@ -1 +1,4 @@ +// Package bubbles provides some components for Bubble Tea applications. These +// components are used in production in Glow, Charm and many other +// applications. package bubbles diff --git a/cursor/cursor.go b/cursor/cursor.go index 1297422..d101332 100644 --- a/cursor/cursor.go +++ b/cursor/cursor.go @@ -1,3 +1,4 @@ +// Package cursor provides cursor functionality for Bubble Tea applications. package cursor import ( diff --git a/filepicker/filepicker.go b/filepicker/filepicker.go index 487ca96..3898742 100644 --- a/filepicker/filepicker.go +++ b/filepicker/filepicker.go @@ -1,3 +1,5 @@ +// Package filepicker provides a file picker component for Bubble Tea +// applications. package filepicker import ( diff --git a/help/help.go b/help/help.go index 85afbee..bb402a6 100644 --- a/help/help.go +++ b/help/help.go @@ -1,3 +1,4 @@ +// Package help provides a simple help view for Bubble Tea applications. package help import ( diff --git a/list/list.go b/list/list.go index 9e3cd03..a96dc77 100644 --- a/list/list.go +++ b/list/list.go @@ -289,7 +289,7 @@ func (m *Model) SetFilterText(filter string) { m.updateKeybindings() } -// Helper method for setting the filtering state manually. +// SetFilterState allows setting the filtering state manually. func (m *Model) SetFilterState(state FilterState) { m.Paginator.Page = 0 m.cursor = 0 diff --git a/progress/progress.go b/progress/progress.go index b5d9f34..82f5eb0 100644 --- a/progress/progress.go +++ b/progress/progress.go @@ -1,3 +1,4 @@ +// Package progress provides a simple progress bar for Bubble Tea applications. package progress import ( diff --git a/spinner/spinner.go b/spinner/spinner.go index ac6e34a..b2d24b0 100644 --- a/spinner/spinner.go +++ b/spinner/spinner.go @@ -1,3 +1,4 @@ +// Package spinner provides a spinner component for Bubble Tea applications. package spinner import ( diff --git a/table/table.go b/table/table.go index 86151f6..ed29d8c 100644 --- a/table/table.go +++ b/table/table.go @@ -1,3 +1,4 @@ +// Package table provides a simple table component for Bubble Tea applications. package table import ( diff --git a/textarea/memoization/memoization.go b/textarea/memoization/memoization.go index ccb80a9..07f3796 100644 --- a/textarea/memoization/memoization.go +++ b/textarea/memoization/memoization.go @@ -1,3 +1,5 @@ +// Package memoization is an internal package that provides a simple memoization +// for text area. package memoization import ( diff --git a/textarea/textarea.go b/textarea/textarea.go index 9af8402..620201c 100644 --- a/textarea/textarea.go +++ b/textarea/textarea.go @@ -1,3 +1,5 @@ +// Package textarea provides a multi-line text input component for Bubble Tea +// applications. package textarea import ( diff --git a/textinput/textinput.go b/textinput/textinput.go index 4c5c10d..84cbbc9 100644 --- a/textinput/textinput.go +++ b/textinput/textinput.go @@ -1,3 +1,5 @@ +// Package textinput provides a text input component for Bubble Tea +// applications. package textinput import ( @@ -760,15 +762,18 @@ func clamp(v, low, high int) int { // Deprecated. -// Deprecated: use cursor.Mode. +// Deprecated: use [cursor.Mode]. +// +//nolint:revive type CursorMode int +//nolint:revive const ( - // Deprecated: use cursor.CursorBlink. + // Deprecated: use [cursor.CursorBlink]. CursorBlink = CursorMode(cursor.CursorBlink) - // Deprecated: use cursor.CursorStatic. + // Deprecated: use [cursor.CursorStatic]. CursorStatic = CursorMode(cursor.CursorStatic) - // Deprecated: use cursor.CursorHide. + // Deprecated: use [cursor.CursorHide]. CursorHide = CursorMode(cursor.CursorHide) ) @@ -776,12 +781,16 @@ func (c CursorMode) String() string { return cursor.Mode(c).String() } -// Deprecated: use cursor.Mode(). +// Deprecated: use [cursor.Mode]. +// +//nolint:revive func (m Model) CursorMode() CursorMode { return CursorMode(m.Cursor.Mode()) } // Deprecated: use cursor.SetMode(). +// +//nolint:revive func (m *Model) SetCursorMode(mode CursorMode) tea.Cmd { return m.Cursor.SetMode(cursor.Mode(mode)) } @@ -819,7 +828,7 @@ func (m *Model) MatchedSuggestions() []string { return m.getSuggestions(m.matchedSuggestions) } -// CurrentSuggestion returns the currently selected suggestion index. +// CurrentSuggestionIndex returns the currently selected suggestion index. func (m *Model) CurrentSuggestionIndex() int { return m.currentSuggestionIndex } diff --git a/viewport/keymap.go b/viewport/keymap.go index 060bb87..86eff98 100644 --- a/viewport/keymap.go +++ b/viewport/keymap.go @@ -1,3 +1,5 @@ +// Package viewport provides a component for rendering a viewport in a Bubble +// Tea. package viewport import "github.com/charmbracelet/bubbles/key" diff --git a/viewport/viewport.go b/viewport/viewport.go index b9bccdf..5862ac0 100644 --- a/viewport/viewport.go +++ b/viewport/viewport.go @@ -178,7 +178,7 @@ func (m *Model) SetYOffset(n int) { m.YOffset = clamp(n, 0, m.maxYOffset()) } -// PageDown moves the view down by the number of lines in the viewport. +// ViewDown moves the view down by the number of lines in the viewport. // Basically, "page down". // // Deprecated: use [Model.PageDown] instead.