Documentation ¶
Overview ¶
Package cmdline is a command line widget.
Index ¶
- func Config(config func(*Cmdline) widget.Keymap)
- func ConfigCompletion(config func(*Completion) widget.Keymap)
- func LoadHistory(path string) error
- func SaveHistory(path string) error
- type Cmdline
- func (c *Cmdline) Disconnect()
- func (c *Cmdline) Draw()
- func (c *Cmdline) DrawLine()
- func (c *Cmdline) Exit()
- func (c *Cmdline) Input(key string)
- func (c *Cmdline) Next() widget.Widget
- func (c *Cmdline) Resize(x, y, width, height int)
- func (c *Cmdline) ResizeRelative(x, y, width, height int)
- func (c *Cmdline) Run()
- func (c *Cmdline) StartCompletion()
- type Completion
- type History
- type Mode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigCompletion ¶
func ConfigCompletion(config func(*Completion) widget.Keymap)
ConfigCompletion sets a completion keymap function.
func LoadHistory ¶
LoadHistory loads from a path and append to history maps of a key as the file name.
Types ¶
type Cmdline ¶
Cmdline is one line text box with a specified mode.
func New ¶
New creates a new cmdline with a specified mode and a history list box. These widget size based on the filer widget.
func (*Cmdline) Draw ¶
func (c *Cmdline) Draw()
Draw the cmdline and the completion or the histry list box
func (*Cmdline) Exit ¶
func (c *Cmdline) Exit()
Exit the cmdline and add a cmdline text to the history.
func (*Cmdline) ResizeRelative ¶
ResizeRelative resizes relative to cmdline current sizes.
func (*Cmdline) Run ¶
func (c *Cmdline) Run()
Run the cmdline mode and add a cmdline text to the history.
func (*Cmdline) StartCompletion ¶
func (c *Cmdline) StartCompletion()
StartCompletion starts a completion based on the cmdline text.
type Completion ¶
Completion is a list box displays completions of the cmdline text.
func NewCompletion ¶
func NewCompletion(x, y, width, height int, cmdline *Cmdline) *Completion
NewCompletion creates a new completion list box.
func (*Completion) Input ¶
func (c *Completion) Input(key string)
Input to the completion or to the cmdline and exits.
func (*Completion) InsertCompletion ¶
func (c *Completion) InsertCompletion()
InsertCompletion inserts a selected completion to the cmdline and exits the completion.
type History ¶
History is the cmdline mode history.
func NewHistory ¶
NewHistory creates a new history list box.
func (*History) CursorDown ¶
func (h *History) CursorDown()
CursorDown downs the history list box cursor and sets a text to the cmdline.
func (*History) CursorUp ¶
func (h *History) CursorUp()
CursorUp ups the history list box cursor and sets a text to the cmdline.
func (*History) MoveCursor ¶
MoveCursor moves the history list box cursor and sets a text to the cmdline.