Skip to content

Commit baa632e

Browse files
committed
Remove PluginCBRune()
Now that we can pass extra args directly to PluginCB(), we can remove PluginCBRune() for simplicity.
1 parent 7861b00 commit baa632e

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

internal/action/bufpane.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,6 @@ func (h *BufPane) PluginCB(cb string, args ...interface{}) bool {
337337
return b
338338
}
339339

340-
// PluginCBRune is the same as PluginCB but also passes a rune to the plugins
341-
func (h *BufPane) PluginCBRune(cb string, r rune) bool {
342-
b, err := config.RunPluginFnBool(h.Buf.Settings, cb, luar.New(ulua.L, h), luar.New(ulua.L, string(r)))
343-
if err != nil {
344-
screen.TermMessage(err)
345-
}
346-
return b
347-
}
348-
349340
func (h *BufPane) resetMouse() {
350341
for me := range h.mousePressed {
351342
delete(h.mousePressed, me)
@@ -633,7 +624,7 @@ func (h *BufPane) DoRuneInsert(r rune) {
633624
// Insert a character
634625
h.Buf.SetCurCursor(c.Num)
635626
h.Cursor = c
636-
if !h.PluginCBRune("preRune", r) {
627+
if !h.PluginCB("preRune", string(r)) {
637628
continue
638629
}
639630
if c.HasSelection() {
@@ -652,7 +643,7 @@ func (h *BufPane) DoRuneInsert(r rune) {
652643
curmacro = append(curmacro, r)
653644
}
654645
h.Relocate()
655-
h.PluginCBRune("onRune", r)
646+
h.PluginCB("onRune", string(r))
656647
}
657648
}
658649

0 commit comments

Comments
 (0)