diff options
author | bx <bx@localhost> | 2016-09-02 07:57:45 -0400 |
---|---|---|
committer | bx <bx@localhost> | 2016-09-02 07:57:45 -0400 |
commit | 25ab84106bd38f586f9c4901160aa6f7162f3cd0 (patch) | |
tree | 1405aa1eda17c2b9e43fb3a96552a55744283b97 | |
parent | 1351d173c25c2c4b78bd197dd3ff0a903b96f3f0 (diff) |
added ctrl-g to docstring and changed implementation to conform to coding style
-rw-r--r-- | alot/widgets/globals.py | 6 |
1 files changed, 2 insertions, 4 deletions
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) |