Add on-redraw hook command (#1479)

* Add `on-redraw` hook command

* Add documentation
This commit is contained in:
Joe Lim authored and GitHub committed 2023-10-30 09:40:24 +11:00
1 parent 7c23c27c59
commit b3cb2dc2b4
4 files changed
+25

No files matched your search

+7
View File
@@ -1151,6 +1151,12 @@ func onChdir(app *app) {
}
}
func onRedraw(app *app) {
if cmd, ok := gOpts.cmds["on-redraw"]; ok {
cmd.eval(app, nil)
}
}
func onSelect(app *app) {
if cmd, ok := gOpts.cmds["on-select"]; ok {
cmd.eval(app, nil)
@@ -1944,6 +1950,7 @@ func (e *callExpr) eval(app *app, args []string) {
dir.boundPos(app.nav.height)
}
app.ui.loadFile(app, true)
onRedraw(app)
case "load":
if !app.nav.init {
return