Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecordKeys ¶
func RecordKeys(eng *Engine)
RecordKeys is being passed every key read by the shell, and will save those entered while the engine is in record mode. All others are ignored.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine manages all things related to keyboard macros: recording, dumping and feeding (running) them to the shell.
func (*Engine) PrintAllMacros ¶
func (e *Engine) PrintAllMacros()
PrintAllMacros dumps all macros to the screen, which one line per saved macro sequence, next to its corresponding key ID.
func (*Engine) PrintLastMacro ¶
func (e *Engine) PrintLastMacro()
PrintLastMacro dumps the last recorded macro sequence to the screen.
func (*Engine) Recording ¶
Recording returns true if the macro engine is recording the keys for a macro.
func (*Engine) RunLastMacro ¶
func (e *Engine) RunLastMacro()
RunLastMacro feeds keys the last recorded macro to the shell's key stack, so that the macro is replayed. Note that this function only feeds the keys of the macro back into the key stack: it does not dispatch them to commands, therefore not running any.
func (*Engine) RunMacro ¶
RunMacro runs a given macro, injecting its key sequence back into the shell key stack. The key argument should either be one of the valid alphanumeric macro identifiers, or a nil rune (in which case the last recorded macro is ran). Note that this function only feeds the keys of the macro back into the key stack: it does not dispatch them to commands, therefore not running any.
func (*Engine) StartRecord ¶
StartRecord starts saving all user key input to record a macro. If the key parameter is an alphanumeric character, the macro recorded will be stored and used through this letter argument, just like macros work in Vim. If the key is neither valid nor the null value, the engine does not start. A notification containing the saved sequence is given through the hint section.
func (*Engine) StopRecord ¶
StopRecord stops using key input as part of a macro. The hint section displaying the currently saved sequence is cleared.