Add on-load command (#2010)
This commit is contained in:
1 parent
b76d2546e1
commit
ff0c7f1c96
6 files changed
+47
-3
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user