implement cmap for command line mapping

This commit is contained in:
Gokcehan committed 2017-03-10 18:53:21 +03:00
1 parent 0969514f10
commit 3fd1222e4f
7 files changed
+191 -97

No files matched your search

+8
View File
@@ -139,6 +139,14 @@ func (e *mapExpr) eval(app *app, args []string) {
gOpts.keys[e.keys] = e.expr
}
func (e *cmapExpr) eval(app *app, args []string) {
if e.cmd == "" {
delete(gOpts.cmdkeys, e.key)
return
}
gOpts.cmdkeys[e.key] = &callExpr{e.cmd, nil}
}
func (e *cmdExpr) eval(app *app, args []string) {
if e.expr == nil {
delete(gOpts.cmds, e.name)