write

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeyMap = KeyMap{
	Confirm: key.NewBinding(
		key.WithKeys("ctrl+d"),
		key.WithHelp("ctrl+d", "confirm"),
	),
	Quit: key.NewBinding(
		key.WithKeys("esc", "ctrl+c"),
		key.WithHelp("esc", "quit"),
	),
}

Functions

This section is empty.

Types

type KeyMap added in v0.8.1

type KeyMap struct {
	Confirm key.Binding
	Quit    key.Binding
}

func (KeyMap) FullHelp added in v0.8.1

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) ShortHelp added in v0.8.1

func (k KeyMap) ShortHelp() []key.Binding

type Model

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

func New

func New(defaultValue string, opts ...Option) *Model

func (Model) Data

func (m Model) Data() string

func (Model) DataString

func (m Model) DataString() string

func (Model) Error added in v0.8.0

func (m Model) Error() error

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) KeyBindings

func (m Model) KeyBindings() []key.Binding

func (Model) Quitting added in v0.8.0

func (m Model) Quitting() bool

func (Model) Update

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

func (Model) UseKeyEnter

func (m Model) UseKeyEnter() bool

func (Model) UseKeyQ

func (m Model) UseKeyQ() bool

func (Model) View

func (m Model) View() string

type Option added in v0.8.0

type Option func(*Model)

func WithHelp added in v0.8.0

func WithHelp(show bool) Option

func WithKeyMap added in v0.8.1

func WithKeyMap(keyMap KeyMap) Option

Jump to

Keyboard shortcuts

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