mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-16 04:11:02 +00:00
parent
981263eb81
commit
f6e9a16724
3 changed files with 36 additions and 3 deletions
|
|
@ -476,6 +476,9 @@ func BindKey(k, v string) {
|
|||
for _, actionName := range actionNames {
|
||||
if strings.HasPrefix(actionName, "Mouse") {
|
||||
mouseActions = append(mouseActions, findMouseAction(actionName))
|
||||
} else if strings.HasPrefix(actionName, "command:") {
|
||||
cmd := strings.SplitN(actionName, ":", 2)[1]
|
||||
actions = append(actions, CommandAction(cmd))
|
||||
} else {
|
||||
actions = append(actions, findAction(actionName))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,6 +120,13 @@ func DefaultCommands() map[string]StrCommand {
|
|||
}
|
||||
}
|
||||
|
||||
func CommandAction(cmd string) func(*View, bool) bool {
|
||||
return func(v *View, usePlugin bool) bool {
|
||||
HandleCommand(cmd)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// PluginCmd installs, removes, updates, lists, or searches for given plugins
|
||||
func PluginCmd(args []string) {
|
||||
if len(args) >= 1 {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue