Documentation
¶
Index ¶
- Constants
- type Config
- type Model
- func (m Model) CursorIndex() int
- func (m Model) FilteredItems() []string
- func (m Model) Init() tea.Cmd
- func (m *Model) MoveCursorDown()
- func (m *Model) MoveCursorUp()
- func (m *Model) PageDown()
- func (m *Model) PageUp()
- func (m Model) Query() string
- func (m *Model) RenderList(reverse bool) []string
- func (m Model) Result() Result
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- type Option
- type Result
- type WindowPosition
Constants ¶
View Source
const ( WindowTop = layout.WindowTop WindowBottom = layout.WindowBottom )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Title string
Prompt string
Matcher matchers.Matcher
Sorter sorters.Sorter
WindowPosition WindowPosition
Output io.Writer
}
Config holds the picker configuration.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (Model) CursorIndex ¶
func (Model) FilteredItems ¶
func (*Model) MoveCursorDown ¶
func (m *Model) MoveCursorDown()
func (*Model) MoveCursorUp ¶
func (m *Model) MoveCursorUp()
func (*Model) RenderList ¶
type Option ¶
type Option func(*Config)
Option configures the picker behavior.
func WithMatcher ¶ added in v0.1.2
func WithOutput ¶
WithOutput sets the output writer used by Bubbletea.
func WithPrompt ¶
WithPrompt sets the input prompt shown before the query.
func WithSorter ¶ added in v0.1.2
func WithWindowPosition ¶
func WithWindowPosition(position WindowPosition) Option
WithWindowPosition sets whether the input is above or below the list.
type WindowPosition ¶
type WindowPosition = layout.WindowPosition
Directories
¶
| Path | Synopsis |
|---|---|
|
orderedchars
Package orderedchars matches when all query characters appear in order.
|
Package orderedchars matches when all query characters appear in order. |
|
substring
Package substring matches when the query exists as a contiguous substring.
|
Package substring matches when the query exists as a contiguous substring. |
|
minipick
Package minipick sorts matches by width and start position.
|
Package minipick sorts matches by width and start position. |
|
most_adjacent
Package most_adjacent sorts matches by their most contiguous match span.
|
Package most_adjacent sorts matches by their most contiguous match span. |
Click to show internal directories.
Click to hide internal directories.