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:
Dmytro Maluka
2025-06-21 02:31:23 +02:00
parent 54ba3cdb4f
commit 7861b00cd1

View File

@@ -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 {