From 5b5280a7b8fb5669d07f80a0c008cbe1c62625f7 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 15 Nov 2019 07:27:17 -0800 Subject: [PATCH] Always clear the status when prompting --- babi.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/babi.py b/babi.py index a621e1a..e5aeb9e 100644 --- a/babi.py +++ b/babi.py @@ -229,6 +229,7 @@ class Status: self._status = '' def prompt(self, screen: 'Screen', prompt: str) -> str: + self.update('') pos = 0 buf = '' while True: @@ -904,9 +905,7 @@ def _edit(screen: Screen) -> EditResult: elif response == ':wq': screen.file.save(screen.status) return EditResult.EXIT - elif response == '': # noop / cancel - screen.status.update('') - else: + elif response != '': # noop / cancel screen.status.update(f'invalid command: {response}') elif key.keyname == b'^S': screen.file.save(screen.status)