write

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 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) TeaProgramOpts added in v0.8.4

func (m Model) TeaProgramOpts() []tea.ProgramOption

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 WithCharLimit added in v0.8.2

func WithCharLimit(limit int) Option

Default is 400. https://github.com/charmbracelet/bubbles/blob/master/textarea/textarea.go#L23

func WithHelp added in v0.8.0

func WithHelp(show bool) Option

func WithKeyMap added in v0.8.1

func WithKeyMap(keyMap KeyMap) Option

func WithLineNumbers added in v0.8.3

func WithLineNumbers(enable bool) Option

func WithTeaProgramOpts added in v0.8.4

func WithTeaProgramOpts(opts ...tea.ProgramOption) Option

func WithWidth added in v0.8.3

func WithWidth(width int) Option

Jump to

Keyboard shortcuts

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