Merge pull request #3245 from dmaluka/onsetactive-fix

Fix issues with `onSetActive` callback
This commit is contained in:
Dmytro Maluka
2024-04-23 21:28:03 +02:00
committed by GitHub
3 changed files with 33 additions and 8 deletions

View File

@@ -689,6 +689,10 @@ func (h *BufPane) Close() {
// SetActive marks this pane as active.
func (h *BufPane) SetActive(b bool) {
if h.IsActive() == b {
return
}
h.BWindow.SetActive(b)
if b {
// Display any gutter messages for this line
@@ -704,8 +708,12 @@ func (h *BufPane) SetActive(b bool) {
if none && InfoBar.HasGutter {
InfoBar.ClearGutter()
}
}
err := config.RunPluginFn("onSetActive", luar.New(ulua.L, h))
if err != nil {
screen.TermMessage(err)
}
}
}
// BufKeyActions contains the list of all possible key actions the bufhandler could execute