Add onSetActive callback (#2885)
Co-authored-by: taconi <igor.tacoi@protonmail.com>
This commit is contained in:
parent
1cbe1441aa
commit
75b9a6cefe
2 changed files with 10 additions and 0 deletions
|
@ -1,9 +1,12 @@
|
|||
package action
|
||||
|
||||
import (
|
||||
luar "layeh.com/gopher-luar"
|
||||
|
||||
"github.com/zyedidia/micro/v2/internal/buffer"
|
||||
"github.com/zyedidia/micro/v2/internal/config"
|
||||
"github.com/zyedidia/micro/v2/internal/display"
|
||||
ulua "github.com/zyedidia/micro/v2/internal/lua"
|
||||
"github.com/zyedidia/micro/v2/internal/screen"
|
||||
"github.com/zyedidia/micro/v2/internal/views"
|
||||
"github.com/zyedidia/tcell/v2"
|
||||
|
@ -276,6 +279,11 @@ 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
|
||||
|
|
|
@ -50,6 +50,8 @@ which micro defines:
|
|||
|
||||
* `postinit()`: initialization function called after `init()`.
|
||||
|
||||
* `onSetActive(bufpane)`: runs when changing the currently active panel.
|
||||
|
||||
* `onBufferOpen(buf)`: runs when a buffer is opened. The input contains
|
||||
the buffer object.
|
||||
|
||||
|
|
Loading…
Reference in a new issue