From 25476e79ef524a60872ff7f89ab49bb331216685 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Sun, 27 Feb 2022 14:09:08 +0300 Subject: [PATCH] add 'on-quit' command to run a command before quit cc #770 --- app.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app.go b/app.go index d757c29..ea4ba6b 100644 --- a/app.go +++ b/app.go @@ -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 <- ""