event

package
Version: v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Absolute

type Absolute struct {
	Offset int64
}

Absolute is the absolute position of the buffer.

type End

type End struct {
	Offset int64
}

End is the end of the buffer.

type Event

type Event struct {
	Type    Type
	Range   *Range
	Count   int64
	Rune    rune
	CmdName string
	Bang    bool
	Arg     string
	Error   error
	Mode    mode.Mode
	Buffer  *buffer.Buffer
}

Event represents the event emitted by UI.

type Position

type Position interface {
	// contains filtered or unexported methods
}

Position ...

func ParsePos

func ParsePos(xs []rune, i int) (Position, int)

ParsePos parses a Position.

+---- num.. ----+
+-- [-+]num.. --+   +---------------+
+------ $ ------+   |               |

---+------ . ------+---+-- [-+]num.. --+---

+-- ' -+- < -+--+
       +- > -+

type Range

type Range struct {
	From Position
	To   Position
}

Range of event

func ParseRange

func ParseRange(xs []rune, i int) (*Range, int)

ParseRange parses a Range.

type Relative

type Relative struct {
	Offset int64
}

Relative is the relative position of the buffer.

type Type

type Type int

Type ...

const (
	Nop Type = iota
	Redraw

	CursorUp
	CursorDown
	CursorLeft
	CursorRight
	CursorPrev
	CursorNext
	CursorHead
	CursorEnd
	CursorGoto
	ScrollUp
	ScrollDown
	ScrollTop
	ScrollTopHead
	ScrollMiddle
	ScrollMiddleHead
	ScrollBottom
	ScrollBottomHead
	PageUp
	PageDown
	PageUpHalf
	PageDownHalf
	PageTop
	PageEnd
	WindowTop
	WindowMiddle
	WindowBottom
	JumpTo
	JumpBack

	DeleteByte
	DeletePrevByte
	Increment
	Decrement
	ShiftLeft
	ShiftRight
	SwitchFocus
	ShowBinary
	ShowDecimal

	StartInsert
	StartInsertHead
	StartAppend
	StartAppendEnd
	StartReplaceByte
	StartReplace

	ExitInsert
	Backspace
	Delete
	Rune

	Undo
	Redo

	StartVisual
	SwitchVisualEnd
	ExitVisual

	Copy
	Cut
	Copied
	Paste
	PastePrev
	Pasted

	StartCmdlineCommand
	StartCmdlineSearchForward
	StartCmdlineSearchBackward
	BackspaceCmdline
	DeleteCmdline
	DeleteWordCmdline
	ClearToHeadCmdline
	ClearCmdline
	ExitCmdline
	CompleteForwardCmdline
	CompleteBackCmdline
	ExecuteCmdline
	ExecuteSearch
	NextSearch
	PreviousSearch
	AbortSearch

	Edit
	Enew
	New
	Vnew
	Only
	Alternative
	Wincmd
	FocusWindowUp
	FocusWindowDown
	FocusWindowLeft
	FocusWindowRight
	FocusWindowTopLeft
	FocusWindowBottomRight
	FocusWindowPrevious
	MoveWindowTop
	MoveWindowBottom
	MoveWindowLeft
	MoveWindowRight
	Suspend
	Quit
	QuitAll
	QuitErr
	Write
	WriteQuit
	Info
	Error
)

Event types

type VisualEnd

type VisualEnd struct {
	Offset int64
}

VisualEnd is the end position of visual selection.

type VisualStart

type VisualStart struct {
	Offset int64
}

VisualStart is the start position of visual selection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL