diff --git a/internal/action/bufpane.go b/internal/action/bufpane.go index 73574859..422debfc 100644 --- a/internal/action/bufpane.go +++ b/internal/action/bufpane.go @@ -679,6 +679,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 @@ -694,8 +698,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 diff --git a/internal/action/tab.go b/internal/action/tab.go index 12803ebf..19189e6e 100644 --- a/internal/action/tab.go +++ b/internal/action/tab.go @@ -327,11 +327,6 @@ func (t *Tab) SetActive(i int) { p.SetActive(false) } } - - err := config.RunPluginFn("onSetActive", luar.New(ulua.L, MainTab().CurPane())) - if err != nil { - screen.TermMessage(err) - } } // GetPane returns the pane with the given split index