Documentation
¶
Overview ¶
Package editor is the multi-line input: history and history search, completion of slash commands and @file mentions, pasted text and images, and handing the input off to the user's $EDITOR.
Index ¶
- func Open(path string, done func(err error) tea.Msg) tea.Cmd
- type Completion
- type Editor
- func (e *Editor) Clear()
- func (e *Editor) Cursor() *tea.Cursor
- func (e *Editor) Dismiss() bool
- func (e *Editor) Empty() bool
- func (e *Editor) Insert(text string)
- func (e *Editor) Menu(width int) []string
- func (e *Editor) SetAccent(c color.Color)
- func (e *Editor) SetHistory(h *History)
- func (e *Editor) SetSession(id string)
- func (e *Editor) SetSuggestion(s string)
- func (e *Editor) SetWidth(w int)
- func (e *Editor) Update(msg tea.Msg) (cmd tea.Cmd, in *Input)
- func (e *Editor) View(width int) string
- type Error
- type History
- type Input
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Completion ¶
type Editor ¶
type Editor struct {
// contains filtered or unexported fields
}
func New ¶
func New(commands func() []Completion, root func() string) *Editor
func (*Editor) Dismiss ¶
Dismiss closes the menu or cancels a history search, restoring the input. It reports whether there was anything to dismiss.
func (*Editor) SetHistory ¶
func (*Editor) SetSession ¶
SetSession sets the session id that new history entries are recorded under.
func (*Editor) SetSuggestion ¶
SetSuggestion shows s while the input is empty; tab or enter accepts it.
type Error ¶
type Error struct{ Err error }
Error reports a failed paste or external edit to the TUI.
type History ¶
type History struct {
// contains filtered or unexported fields
}
History holds a project's inputs, newest first. All projects share one JSON lines file.
func NewHistory ¶
func (*History) SetSession ¶
Click to show internal directories.
Click to hide internal directories.