Engine manages all things related to keyboard macros:
recording, dumping and feeding (running) them to the shell. PrintAllMacros dumps all macros to the screen, which one line
per saved macro sequence, next to its corresponding key ID. PrintLastMacro dumps the last recorded macro sequence to the screen. Recording returns true if the macro engine is recording the keys for a macro. 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. 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. 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. StopRecord stops using key input as part of a macro.
The hint section displaying the currently saved sequence is cleared.
func NewEngine(keys *core.Keys, hint *ui.Hint) *Engine
func RecordKeys(eng *Engine)
Package-Level Functions (total 2)
NewEngine is a required constructor to setup a working macro 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.
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.