From 7fc93313bc6b14ea1071a1c02ea0cf6d7cc3a803 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Fri, 2 Sep 2016 21:07:34 +0300 Subject: [PATCH] skip ui drawing if exit flag is set Mentioned in #15. --- app.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.go b/app.go index b8cf567..dc5f053 100644 --- a/app.go +++ b/app.go @@ -39,6 +39,8 @@ func waitKey() error { func (app *App) handleInp() { for { + // exit check is done on the top just in case user quits + // before input handling for some reason (e.g. in configuration file) if gExitFlag { log.Print("bye!") @@ -64,6 +66,9 @@ func (app *App) handleInp() { continue } e.eval(app, nil) + if gExitFlag { + continue + } app.ui.draw(app.nav) } }