From 0694cd2c1b5b910b61f372e84d305a4b3d9d8665 Mon Sep 17 00:00:00 2001 From: Dmytro Maluka Date: Sat, 5 Jul 2025 17:16:15 +0200 Subject: [PATCH] help: Document passing *tcell.EventMouse to mouse action callbacks --- runtime/help/plugins.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runtime/help/plugins.md b/runtime/help/plugins.md index 4a8b8a68..4de98ede 100644 --- a/runtime/help/plugins.md +++ b/runtime/help/plugins.md @@ -76,10 +76,19 @@ that micro defines: chained with other actions (see `> help keybindings`) to determine whether the next actions in the chain should be executed or not. + If the action is a mouse action, e.g. `MousePress`, the mouse event info + is passed to the callback as an extra argument of type `*tcell.EventMouse`. + See https://pkg.go.dev/github.com/micro-editor/tcell/v2#EventMouse for the + description of this type and its methods. + * `preAction(bufpane)`: runs immediately before `Action` is triggered by the user. Returns a boolean which defines whether the action should be canceled. + Similarly to `onAction`, if the action is a mouse action, the mouse event + info is passed to the callback as an extra argument of type + `*tcell.EventMouse`. + * `onRune(bufpane, rune)`: runs when the composed rune has been inserted * `preRune(bufpane, rune)`: runs before the composed rune will be inserted