skip ui drawing if exit flag is set

Mentioned in #15.
This commit is contained in:
Gokcehan committed 2016-09-02 21:20:01 +03:00
1 parent dde01fce0a
commit 7fc93313bc
1 file changed
+5
+5
View File
@@ -39,6 +39,8 @@ func waitKey() error {
func (app *App) handleInp() { func (app *App) handleInp() {
for { 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 { if gExitFlag {
log.Print("bye!") log.Print("bye!")
@@ -64,6 +66,9 @@ func (app *App) handleInp() {
continue continue
} }
e.eval(app, nil) e.eval(app, nil)
if gExitFlag {
continue
}
app.ui.draw(app.nav) app.ui.draw(app.nav)
} }
} }