suggestions

package
v0.0.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuggestionWidth  = 40
	DescriptionWidth = 30
	BorderOffset     = 2
	MaxSuggestions   = 5
)

Variables

View Source
var ArgumentDescriptionBorder = lipgloss.Border{
	Top:         "",
	Bottom:      "─",
	Left:        "│",
	Right:       "│",
	TopLeft:     "",
	TopRight:    "",
	BottomLeft:  "└",
	BottomRight: "┘",
}
View Source
var SuggestionWithDescriptionBorder = lipgloss.Border{
	Top:         "─",
	Bottom:      "─",
	Left:        "│",
	Right:       "│",
	TopLeft:     "┌",
	TopRight:    "┐",
	BottomLeft:  "├",
	BottomRight: "┤",
}

Functions

func SuggestCmd

func SuggestCmd(cmd string, suggestionId uuid.UUID) tea.Cmd

Types

type KeyMap

type KeyMap struct {
	LineUp   key.Binding
	LineDown key.Binding
	PageUp   key.Binding
	PageDown key.Binding
}

type Model

type Model struct {
	// contains filtered or unexported fields
}

func New

func New() Model

func (Model) ActiveSuggestion

func (m Model) ActiveSuggestion() (string, int)

func (Model) HasActiveSuggestion

func (m Model) HasActiveSuggestion() bool

func (*Model) Init

func (m *Model) Init(command string) tea.Cmd

func (*Model) ResetCursor

func (m *Model) ResetCursor()

func (Model) Update

func (m Model) Update(msg tea.Msg, command string, userInputCursorLocation int) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type SuggestionMessage

type SuggestionMessage struct {
	Id                  uuid.UUID
	Suggestions         []autocomplete.Suggestion
	ArgumentDescription string
	RunesToRemove       int
}

Jump to

Keyboard shortcuts

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