add 'on-quit' command to run a command before quit

cc #770
This commit is contained in:
Gokcehan 2022-02-27 14:09:08 +03:00
parent fb66a21577
commit 25476e79ef

4
app.go
View File

@ -374,6 +374,10 @@ func (app *app) loop() {
continue
}
if cmd, ok := gOpts.cmds["on-quit"]; ok {
cmd.eval(app, nil)
}
app.quit()
app.nav.previewChan <- ""