multibar

package
v0.0.0-...-40e63e7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHistory

func NewHistory() *history

Types

type InputMode

type InputMode int
const (
	ModeNormal InputMode = iota
	ModeInput
	ModeSearch
)

Different input modes are handled in different ways. Check Multibar.inputMode against these constants.

func (InputMode) String

func (m InputMode) String() string

type Multibar

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

Multibar implements a Vi-like combined statusbar and input box.

func New

func New(tcf TabCompleterFactory) *Multibar

func (*Multibar) Clear

func (m *Multibar) Clear()

Clear the statusbar text

func (*Multibar) Commands

func (m *Multibar) Commands() <-chan string

Commands returns a channel sending any commands entered in input mode.

func (*Multibar) Cursor

func (m *Multibar) Cursor() int

Cursor returns the cursor position.

func (*Multibar) Error

func (m *Multibar) Error(err error)

Set an error in the statusbar

func (*Multibar) History

func (m *Multibar) History() *history

History returns the input history of the current input mode.

func (*Multibar) Input

func (m *Multibar) Input(event tcell.Event) bool

Input is called on keyboard events.

func (*Multibar) Len

func (m *Multibar) Len() int

func (*Multibar) Mode

func (m *Multibar) Mode() InputMode

func (*Multibar) Searches

func (m *Multibar) Searches() <-chan string

Searches returns a channel sending any search terms.

func (*Multibar) SetMessage

func (m *Multibar) SetMessage(msg string)

func (*Multibar) SetMode

func (m *Multibar) SetMode(mode InputMode)

func (*Multibar) String

func (m *Multibar) String() string

type TabCompleter

type TabCompleter interface {
	Scan() (string, error)
}

type TabCompleterFactory

type TabCompleterFactory func(input string) TabCompleter

Jump to

Keyboard shortcuts

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