mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-07 07:30:20 +09:00
Pass mouse info to {on,pre}MouseXXX callbacks
Pass *tcell.EventMouse to action callbacks for "mouse actions", i.e. to onMousePress, preMouseDrag and so on, similarly to how we pass it to lua functions bound to mouse events.
This commit is contained in:
@@ -566,7 +566,7 @@ func (h *BufPane) execAction(action BufAction, name string, te *tcell.EventMouse
|
||||
h.Buf.HasSuggestions = false
|
||||
}
|
||||
|
||||
if !h.PluginCB("pre" + name) {
|
||||
if !h.PluginCB("pre"+name, te) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -577,7 +577,7 @@ func (h *BufPane) execAction(action BufAction, name string, te *tcell.EventMouse
|
||||
case BufMouseAction:
|
||||
success = a(h, te)
|
||||
}
|
||||
success = success && h.PluginCB("on"+name)
|
||||
success = success && h.PluginCB("on"+name, te)
|
||||
|
||||
if _, ok := MultiActions[name]; ok {
|
||||
if recordingMacro {
|
||||
|
||||
Reference in New Issue
Block a user