Add on-load command (#2010)

This commit is contained in:
CatsDeservePets authored and GitHub committed 2025-06-20 17:36:57 +10:00
1 parent b76d2546e1
commit ff0c7f1c96
6 files changed
+47 -3

No files matched your search

+11
View File
@@ -593,6 +593,17 @@ func onChdir(app *app) {
}
}
func onLoad(app *app, files []string) {
// prevent infinite loops
if !gOpts.dircache {
return
}
if cmd, ok := gOpts.cmds["on-load"]; ok {
cmd.eval(app, files)
}
}
func onFocusGained(app *app) {
if cmd, ok := gOpts.cmds["on-focus-gained"]; ok {
cmd.eval(app, nil)