textinput

package module
v0.0.0-...-7db7068 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 4 Imported by: 1

README

Textinput with auto-completion

This is a simple wrapper around the github.com/charmbracelet/bubbles/textinput, with support for auto-completion.

The API is almost the same as the github.com/charmbracelet/bubbles/textinput, except users can optionally set the .CandidateWords to indicate the candidate words for auto-completion, which is triggered by tab/shift-tab.

See the example for a demo, and also compare it with the bubbletea textinput example to see the usage difference.

Documentation

Index

Constants

View Source
const (
	EchoNormal   = textinput.EchoNormal
	EchoPassword = textinput.EchoPassword
	EchoNone     = textinput.EchoNone

	CursorBlink  = textinput.CursorBlink
	CursorStatic = textinput.CursorStatic
	CursorHide   = textinput.CursorHide
)

Variables

This section is empty.

Functions

func Blink() tea.Msg

func Paste

func Paste() tea.Msg

Types

type CandidateViewMode

type CandidateViewMode int
const (
	CandidateViewVertical CandidateViewMode = iota
	CandidateViewHorizental
	CandidateViewNone
)

type CursorMode

type CursorMode = textinput.CursorMode

type EchoMode

type EchoMode = textinput.EchoMode

type Model

type Model struct {
	textinput.Model
	CandidateWords []string

	CandidateViewMode CandidateViewMode
	Width             int

	StyleMatching  lipgloss.Style
	StyleCandidate lipgloss.Style
	// contains filtered or unexported fields
}

func NewModel

func NewModel() Model

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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