From 25ab84106bd38f586f9c4901160aa6f7162f3cd0 Mon Sep 17 00:00:00 2001 From: bx Date: Fri, 2 Sep 2016 07:57:45 -0400 Subject: added ctrl-g to docstring and changed implementation to conform to coding style --- alot/widgets/globals.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'alot/widgets/globals.py') diff --git a/alot/widgets/globals.py b/alot/widgets/globals.py index b636a3af..b72c742e 100644 --- a/alot/widgets/globals.py +++ b/alot/widgets/globals.py @@ -84,7 +84,7 @@ class CompleteEdit(urwid.Edit): The interpretation of some keypresses is hard-wired: :enter: calls 'on_exit' callback with current value - :esc: calls 'on_exit' with value `None`, which can be interpreted + :esc/ctrl g: calls 'on_exit' with value `None`, which can be interpreted as cancelation :tab: calls the completer and tabs forward in the result list :shift tab: tabs backward in the result list @@ -168,9 +168,7 @@ class CompleteEdit(urwid.Edit): self.set_edit_text(self.history[self.historypos]) elif key == 'enter': self.on_exit(self.edit_text) - elif key == 'esc': - self.on_exit(None) - elif key == 'ctrl g': + elif key in ('ctrl g', 'esc'): self.on_exit(None) elif key == 'ctrl a': self.set_edit_pos(0) -- cgit v1.2.3