minibuffer

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package minibuffer todo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(w *Widget, container gowid.ISettableComposite, width gowid.IWidgetDimension, app gowid.IApp)

w is minibuffer container is main view

Types

type IAction

type IAction interface {
	Run(gowid.IApp, ...string) error // nil means success
	Arguments([]string, gowid.IApp) []IArg
	OfferCompletion() bool
}

IAction represents a command that can be run in the minibuffer e.g. "set". It can decide whether or not to show in the list of completions e.g. if the user types "s".

type IArg

type IArg interface {
	OfferCompletion() bool
	Completions() []string
}

IArg represents an argument to a minibuffer command e.g. "dark-mode" in the command "set dark-mode on".

type Widget

type Widget struct {
	*dialog.Widget
	// contains filtered or unexported fields
}

Widget represents a termshark-specific "minibuffer" widget, expected to be opened as a dialog near the bottom of the screen. It allows the user to type commands and supports tab completion and listing completions.

func New

func New() *Widget

func (*Widget) Register

func (w *Widget) Register(name string, action IAction)

Not thread-safe, manage via App perhaps

Jump to

Keyboard shortcuts

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