mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-16 01:43:21 +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
|
package bubbles
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// Package cursor provides cursor functionality for Bubble Tea applications.
|
||||||
package cursor
|
package cursor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// Package filepicker provides a file picker component for Bubble Tea
|
||||||
|
// applications.
|
||||||
package filepicker
|
package filepicker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// Package help provides a simple help view for Bubble Tea applications.
|
||||||
package help
|
package help
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
+1
-1
@@ -289,7 +289,7 @@ func (m *Model) SetFilterText(filter string) {
|
|||||||
m.updateKeybindings()
|
m.updateKeybindings()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper method for setting the filtering state manually.
|
// SetFilterState allows setting the filtering state manually.
|
||||||
func (m *Model) SetFilterState(state FilterState) {
|
func (m *Model) SetFilterState(state FilterState) {
|
||||||
m.Paginator.Page = 0
|
m.Paginator.Page = 0
|
||||||
m.cursor = 0
|
m.cursor = 0
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// Package progress provides a simple progress bar for Bubble Tea applications.
|
||||||
package progress
|
package progress
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// Package spinner provides a spinner component for Bubble Tea applications.
|
||||||
package spinner
|
package spinner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// Package table provides a simple table component for Bubble Tea applications.
|
||||||
package table
|
package table
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// Package memoization is an internal package that provides a simple memoization
|
||||||
|
// for text area.
|
||||||
package memoization
|
package memoization
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// Package textarea provides a multi-line text input component for Bubble Tea
|
||||||
|
// applications.
|
||||||
package textarea
|
package textarea
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
+15
-6
@@ -1,3 +1,5 @@
|
|||||||
|
// Package textinput provides a text input component for Bubble Tea
|
||||||
|
// applications.
|
||||||
package textinput
|
package textinput
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -760,15 +762,18 @@ func clamp(v, low, high int) int {
|
|||||||
|
|
||||||
// Deprecated.
|
// Deprecated.
|
||||||
|
|
||||||
// Deprecated: use cursor.Mode.
|
// Deprecated: use [cursor.Mode].
|
||||||
|
//
|
||||||
|
//nolint:revive
|
||||||
type CursorMode int
|
type CursorMode int
|
||||||
|
|
||||||
|
//nolint:revive
|
||||||
const (
|
const (
|
||||||
// Deprecated: use cursor.CursorBlink.
|
// Deprecated: use [cursor.CursorBlink].
|
||||||
CursorBlink = CursorMode(cursor.CursorBlink)
|
CursorBlink = CursorMode(cursor.CursorBlink)
|
||||||
// Deprecated: use cursor.CursorStatic.
|
// Deprecated: use [cursor.CursorStatic].
|
||||||
CursorStatic = CursorMode(cursor.CursorStatic)
|
CursorStatic = CursorMode(cursor.CursorStatic)
|
||||||
// Deprecated: use cursor.CursorHide.
|
// Deprecated: use [cursor.CursorHide].
|
||||||
CursorHide = CursorMode(cursor.CursorHide)
|
CursorHide = CursorMode(cursor.CursorHide)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -776,12 +781,16 @@ func (c CursorMode) String() string {
|
|||||||
return cursor.Mode(c).String()
|
return cursor.Mode(c).String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: use cursor.Mode().
|
// Deprecated: use [cursor.Mode].
|
||||||
|
//
|
||||||
|
//nolint:revive
|
||||||
func (m Model) CursorMode() CursorMode {
|
func (m Model) CursorMode() CursorMode {
|
||||||
return CursorMode(m.Cursor.Mode())
|
return CursorMode(m.Cursor.Mode())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: use cursor.SetMode().
|
// Deprecated: use cursor.SetMode().
|
||||||
|
//
|
||||||
|
//nolint:revive
|
||||||
func (m *Model) SetCursorMode(mode CursorMode) tea.Cmd {
|
func (m *Model) SetCursorMode(mode CursorMode) tea.Cmd {
|
||||||
return m.Cursor.SetMode(cursor.Mode(mode))
|
return m.Cursor.SetMode(cursor.Mode(mode))
|
||||||
}
|
}
|
||||||
@@ -819,7 +828,7 @@ func (m *Model) MatchedSuggestions() []string {
|
|||||||
return m.getSuggestions(m.matchedSuggestions)
|
return m.getSuggestions(m.matchedSuggestions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CurrentSuggestion returns the currently selected suggestion index.
|
// CurrentSuggestionIndex returns the currently selected suggestion index.
|
||||||
func (m *Model) CurrentSuggestionIndex() int {
|
func (m *Model) CurrentSuggestionIndex() int {
|
||||||
return m.currentSuggestionIndex
|
return m.currentSuggestionIndex
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// Package viewport provides a component for rendering a viewport in a Bubble
|
||||||
|
// Tea.
|
||||||
package viewport
|
package viewport
|
||||||
|
|
||||||
import "github.com/charmbracelet/bubbles/key"
|
import "github.com/charmbracelet/bubbles/key"
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ func (m *Model) SetYOffset(n int) {
|
|||||||
m.YOffset = clamp(n, 0, m.maxYOffset())
|
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".
|
// Basically, "page down".
|
||||||
//
|
//
|
||||||
// Deprecated: use [Model.PageDown] instead.
|
// Deprecated: use [Model.PageDown] instead.
|
||||||
|
|||||||
Reference in New Issue
Block a user