mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-19 07:15:34 -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"
|
isatty "github.com/mattn/go-isatty"
|
||||||
"github.com/micro-editor/tcell/v2"
|
"github.com/micro-editor/tcell/v2"
|
||||||
lua "github.com/yuin/gopher-lua"
|
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/action"
|
||||||
"github.com/zyedidia/micro/v2/internal/buffer"
|
"github.com/zyedidia/micro/v2/internal/buffer"
|
||||||
"github.com/zyedidia/micro/v2/internal/clipboard"
|
"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 {
|
if err != nil {
|
||||||
screen.TermMessage(err)
|
screen.TermMessage(err)
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ that micro defines:
|
|||||||
|
|
||||||
* `preRune(bufpane, rune)`: runs before the composed rune will be inserted
|
* `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
|
detecting various changes of micro's state that cannot be detected
|
||||||
using other callbacks.
|
using other callbacks.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user