From 09c73b643843b6f88e09de0765b8ea1b84910099 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Sat, 13 Feb 2021 12:41:16 -0500 Subject: [PATCH] Implement confirm_quit config option --- lightcards/display.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lightcards/display.py b/lightcards/display.py index cb52c8d..386058f 100644 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -50,14 +50,14 @@ class Quit: (mlines, mcols) = self.outer.win.getmaxyx() self.win.mvwin(int(mlines / 2) - 3, int(mcols / 2) - 10) self.panel.show() - - while True: - key = self.win.getkey() - if key == "y": - break - elif key == "n": - self.panel.hide() - self.outer.get_key() + if self.outer.config["confirm_quit"]: + while True: + key = self.win.getkey() + if key == "y": + break + elif key == "n": + self.panel.hide() + self.outer.get_key() class Help: -- 2.39.2