mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-16 05:47:06 +09:00
@@ -476,6 +476,9 @@ func BindKey(k, v string) {
|
|||||||
for _, actionName := range actionNames {
|
for _, actionName := range actionNames {
|
||||||
if strings.HasPrefix(actionName, "Mouse") {
|
if strings.HasPrefix(actionName, "Mouse") {
|
||||||
mouseActions = append(mouseActions, findMouseAction(actionName))
|
mouseActions = append(mouseActions, findMouseAction(actionName))
|
||||||
|
} else if strings.HasPrefix(actionName, "command:") {
|
||||||
|
cmd := strings.SplitN(actionName, ":", 2)[1]
|
||||||
|
actions = append(actions, CommandAction(cmd))
|
||||||
} else {
|
} else {
|
||||||
actions = append(actions, findAction(actionName))
|
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
|
// PluginCmd installs, removes, updates, lists, or searches for given plugins
|
||||||
func PluginCmd(args []string) {
|
func PluginCmd(args []string) {
|
||||||
if len(args) >= 1 {
|
if len(args) >= 1 {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user