completion

package
v1.18.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseMsg

type CloseMsg struct{}

type ClosedMsg

type ClosedMsg struct{}

type Item

type Item struct {
	Label       string
	Description string
	Value       string
	Execute     func() tea.Cmd
	Pinned      bool // Pinned items always appear at the top, in original order
}

type Manager

type Manager interface {
	layout.Model

	GetLayers() []*lipgloss.Layer
	Open() bool
	// SetEditorBottom sets the height from the bottom of the screen where the editor ends.
	// This is used to position the completion popup above the editor.
	SetEditorBottom(height int)
}

Manager manages the dialog stack and rendering

func New

func New() Manager

New creates a new completion component

type MatchMode added in v1.18.8

type MatchMode int

MatchMode defines how completion items are filtered

const (
	// MatchFuzzy uses fuzzy matching (matches anywhere in label)
	MatchFuzzy MatchMode = iota
	// MatchPrefix requires the query to match the start of the label
	MatchPrefix
)

type OpenMsg

type OpenMsg struct {
	Items     []Item
	MatchMode MatchMode
}

type OpenedMsg

type OpenedMsg struct{}

type QueryMsg

type QueryMsg struct {
	Query string
}

type SelectedMsg

type SelectedMsg struct {
	Value   string
	Execute func() tea.Cmd
}

type SelectionChangedMsg added in v1.18.8

type SelectionChangedMsg struct {
	Value string
}

SelectionChangedMsg is sent when the selected item changes (for preview in editor)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL