Add onBufPaneOpen error checking (#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.
This commit is contained in:
parent
eec068a4fc
commit
e48575f349
1 changed files with 5 additions and 1 deletions
|
@ -290,7 +290,11 @@ func NewBufPaneFromBuf(buf *buffer.Buffer, tab *Tab) *BufPane {
|
|||
func (h *BufPane) finishInitialize() {
|
||||
h.initialRelocate()
|
||||
h.initialized = true
|
||||
config.RunPluginFn("onBufPaneOpen", luar.New(ulua.L, h))
|
||||
|
||||
err := config.RunPluginFn("onBufPaneOpen", luar.New(ulua.L, h))
|
||||
if err != nil {
|
||||
screen.TermMessage(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Resize resizes the pane
|
||||
|
|
Loading…
Reference in a new issue