Documentation
¶
Overview ¶
Package engine is a small real-time Vim emulator: feed it keystrokes, it mutates buffer/cursor/mode state and reports what happened.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GoalTypes = []string{
"cursorOnWord", "bufferEquals", "lineDeleted",
"wordDeleted", "containsText", "searchMatchActive",
}
GoalTypes lists every valid Goal.Type, for content validation.
Functions ¶
This section is empty.
Types ¶
type Goal ¶
type Goal struct {
Type string `json:"type"`
Word string `json:"word,omitempty"`
Line string `json:"line,omitempty"`
Lines []string `json:"lines,omitempty"`
Text string `json:"text,omitempty"`
Term string `json:"term,omitempty"`
}
Goal is a challenge success condition, decoded straight from lesson JSON.
type Simulator ¶
type Simulator struct {
Buffer []string
Cursor Pos
Mode Mode
// AllowedKeys restricts normal-mode commands; nil allows everything.
AllowedKeys map[string]bool
SearchQuery string
// contains filtered or unexported fields
}
func (*Simulator) LastSearch ¶
func (*Simulator) Pending ¶
Pending returns the visible pending state ("d", "3", "3d", "di", "g") for the HUD.
func (*Simulator) WordAtCursor ¶
WordAtCursor returns the space-delimited word under the cursor, or "".
Click to show internal directories.
Click to hide internal directories.