mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 04:36:07 +00:00
fix: golangci-lint 2 fixes (#769)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Package cursor provides cursor functionality for Bubble Tea applications.
|
||||
package cursor
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Package filepicker provides a file picker component for Bubble Tea
|
||||
// applications.
|
||||
package filepicker
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Package help provides a simple help view for Bubble Tea applications.
|
||||
package help
|
||||
|
||||
import (
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Package progress provides a simple progress bar for Bubble Tea applications.
|
||||
package progress
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Package spinner provides a spinner component for Bubble Tea applications.
|
||||
package spinner
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Package table provides a simple table component for Bubble Tea applications.
|
||||
package table
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Package memoization is an internal package that provides a simple memoization
|
||||
// for text area.
|
||||
package memoization
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Package textarea provides a multi-line text input component for Bubble Tea
|
||||
// applications.
|
||||
package textarea
|
||||
|
||||
import (
|
||||
|
||||
+15
-6
@@ -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
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user