Skip to content

Commit e48575f

Browse files
authored
Add onBufPaneOpen error checking (zyedidia#3246)
If onBufPaneOpen callback execution fails (e.g. due to a Lua runtime error), report this error to the user, like we do for all other Lua callbacks, rather than silently continue working as if nothing happened.
1 parent eec068a commit e48575f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/action/bufpane.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,11 @@ func NewBufPaneFromBuf(buf *buffer.Buffer, tab *Tab) *BufPane {
290290
func (h *BufPane) finishInitialize() {
291291
h.initialRelocate()
292292
h.initialized = true
293-
config.RunPluginFn("onBufPaneOpen", luar.New(ulua.L, h))
293+
294+
err := config.RunPluginFn("onBufPaneOpen", luar.New(ulua.L, h))
295+
if err != nil {
296+
screen.TermMessage(err)
297+
}
294298
}
295299

296300
// Resize resizes the pane

0 commit comments

Comments
 (0)