mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 14:55:38 -04:00
Add event argument to onAnyEvent callback
This commit is contained in:
parent
5eddf5b85d
commit
06085865d0
@ -20,6 +20,8 @@ import (
|
||||
isatty "github.com/mattn/go-isatty"
|
||||
"github.com/micro-editor/tcell/v2"
|
||||
lua "github.com/yuin/gopher-lua"
|
||||
luar "layeh.com/gopher-luar"
|
||||
ulua "github.com/zyedidia/micro/v2/internal/lua"
|
||||
"github.com/zyedidia/micro/v2/internal/action"
|
||||
"github.com/zyedidia/micro/v2/internal/buffer"
|
||||
"github.com/zyedidia/micro/v2/internal/clipboard"
|
||||
@ -519,7 +521,7 @@ func DoEvent() {
|
||||
}
|
||||
}
|
||||
|
||||
err := config.RunPluginFn("onAnyEvent")
|
||||
err := config.RunPluginFn("onAnyEvent", luar.New(ulua.L, event))
|
||||
if err != nil {
|
||||
screen.TermMessage(err)
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ that micro defines:
|
||||
|
||||
* `preRune(bufpane, rune)`: runs before the composed rune will be inserted
|
||||
|
||||
* `onAnyEvent()`: runs when literally anything happens. It is useful for
|
||||
* `onAnyEvent(event)`: runs when literally anything happens. It is useful for
|
||||
detecting various changes of micro's state that cannot be detected
|
||||
using other callbacks.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user