plugins: Add capability to dis-/enable them per buffer (#2836)

This commit is contained in:
Jöran Karl
2023-06-06 02:38:33 +02:00
committed by GitHub
parent 1b4f6ecb12
commit c46467b5b9
7 changed files with 50 additions and 16 deletions

View File

@@ -306,7 +306,7 @@ func (h *BufPane) ResizePane(size int) {
// PluginCB calls all plugin callbacks with a certain name and displays an
// error if there is one and returns the aggregrate boolean response
func (h *BufPane) PluginCB(cb string) bool {
b, err := config.RunPluginFnBool(cb, luar.New(ulua.L, h))
b, err := config.RunPluginFnBool(h.Buf.Settings, cb, luar.New(ulua.L, h))
if err != nil {
screen.TermMessage(err)
}
@@ -315,7 +315,7 @@ func (h *BufPane) PluginCB(cb string) bool {
// PluginCBRune is the same as PluginCB but also passes a rune to the plugins
func (h *BufPane) PluginCBRune(cb string, r rune) bool {
b, err := config.RunPluginFnBool(cb, luar.New(ulua.L, h), luar.New(ulua.L, string(r)))
b, err := config.RunPluginFnBool(h.Buf.Settings, cb, luar.New(ulua.L, h), luar.New(ulua.L, string(r)))
if err != nil {
screen.TermMessage(err)
}