mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 06:37:14 +09:00
Run action completion on saves with prompts at the right time
This commit is contained in:
@@ -361,8 +361,8 @@ func (h *BufPane) execAction(action func(*BufPane) bool, name string, cursor int
|
||||
_, isMulti := MultiActions[name]
|
||||
if (!isMulti && cursor == 0) || isMulti {
|
||||
if h.PluginCB("pre" + name) {
|
||||
asuccess := action(h)
|
||||
psuccess := h.PluginCB("on" + name)
|
||||
success := action(h)
|
||||
success = success && h.PluginCB("on"+name)
|
||||
|
||||
if isMulti {
|
||||
if recording_macro {
|
||||
@@ -372,13 +372,17 @@ func (h *BufPane) execAction(action func(*BufPane) bool, name string, cursor int
|
||||
}
|
||||
}
|
||||
|
||||
return asuccess && psuccess
|
||||
return success
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (h *BufPane) completeAction(action string) {
|
||||
h.PluginCB("on" + action)
|
||||
}
|
||||
|
||||
func (h *BufPane) HasKeyEvent(e Event) bool {
|
||||
_, ok := BufKeyBindings[e]
|
||||
return ok
|
||||
|
||||
Reference in New Issue
Block a user