core

package
v0.0.0-...-aefb38e Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Rune = iota

	CtrlA
	CtrlB
	CtrlC
	CtrlD
	CtrlE
	CtrlF
	CtrlG
	CtrlH
	Tab
	CtrlJ
	CtrlK
	CtrlL
	CtrlM
	CtrlN
	CtrlO
	CtrlP
	CtrlQ
	CtrlR
	CtrlS
	CtrlT
	CtrlU
	CtrlV
	CtrlW
	CtrlX
	CtrlY
	CtrlZ
	ESC
	CtrlSpace

	Invalid
	Resize
	Mouse
	DoubleClick

	BTab
	BSpace

	Del
	PgUp
	PgDn

	Left
	Right
	Home
	End

	SLeft
	SRight
	SUp
	SDown

	F1
	F2
	F3
	F4
	F5
	F6
	F7
	F8
	F9
	F10
	F11
	F12

	Change

	AltSpace
	AltSlash
	AltBS

	Alt0

	AltA = Alt0 + 'a' - '0' + iota
	AltB
	AltC
	AltD
	AltE
	AltF
	AltZ     = AltA + 'z' - 'a'
	CtrlAltA = AltZ + 1
	CtrlAltM = CtrlAltA + 'm' - 'a'
)

Variables

This section is empty.

Functions

func Constrain

func Constrain(val int, min int, max int) int

Constrain limits the given integer with the upper and lower bounds

func InputParser

func InputParser(s tcell.Screen, commands chan Executer, wg *sync.WaitGroup)

func ProcessCommands

func ProcessCommands(
	commands <-chan Executer,
	states chan<- State,
	lastStateChan chan<- *State,
	stdin string,
	query string,
	wg *sync.WaitGroup,
)

Types

type Buf

type Buf struct {
	Lines  []string
	Status int
	Scroll int
	Cmd    string
	Index  int
	Stdin  bool
}

type Event

type Event struct {
	Type       int
	Char       rune
	MouseEvent *events.MouseEvent
}

func GetChar

func GetChar(ev interface{}) Event

func (Event) Execute

func (e Event) Execute(oldState State) (State, error)

type Executer

type Executer interface {
	Execute(State) (State, error)
}

Executer represents a user action triggered on a State

type Line

type Line struct {
	Text []rune
}

type LineInput

type LineInput struct {
	Input  []rune
	Cx     int
	Yanked []rune
}

type State

type State struct {
	Buffers        []Buf
	ExitCodes      []int
	LineInput      LineInput
	Stdin          []string
	SelectedWidget int
}

type VisualState

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

func NewVisualState

func NewVisualState(linesArray []string, style tcell.Style) VisualState

func NewVisualStateWithOffset

func NewVisualStateWithOffset(linesArray []string, style tcell.Style, offset int) VisualState

func (VisualState) GetBounds

func (vs VisualState) GetBounds() (int, int)

func (VisualState) GetCell

func (vs VisualState) GetCell(x, y int) (rune, tcell.Style, []rune, int)

func (VisualState) GetCursor

func (VisualState) GetCursor() (int, int, bool, bool)

func (VisualState) MoveCursor

func (VisualState) MoveCursor(offx, offy int)

func (VisualState) SetCursor

func (VisualState) SetCursor(int, int)

Jump to

Keyboard shortcuts

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