summaryrefslogtreecommitdiff
path: root/alot/widgets/globals.py
diff options
context:
space:
mode:
authorYour Name <you@example.com>2014-06-11 17:10:30 +0200
committerPatrick Totzke <patricktotzke@gmail.com>2014-08-02 17:36:46 +0200
commit754c890a978e93bbaa45460341034360105c979f (patch)
treefe2ec6445bf7ca1904b1e371125d8a4bd0480efe /alot/widgets/globals.py
parentc02fbc1ce0da5d048c3aafee9271c014c12a38a7 (diff)
Add documentation and more shortcuts
Diffstat (limited to 'alot/widgets/globals.py')
-rw-r--r--alot/widgets/globals.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/alot/widgets/globals.py b/alot/widgets/globals.py
index 9abbb291..a72e7d65 100644
--- a/alot/widgets/globals.py
+++ b/alot/widgets/globals.py
@@ -89,7 +89,14 @@ class CompleteEdit(urwid.Edit):
:tab: calls the completer and tabs forward in the result list
:shift tab: tabs backward in the result list
:up/down: move in the local input history
+ :ctrl f/b: moves curser one character to the right/left
+ :meta f/b shift right/left: moves the cursor one word to the right/left
:ctrl a/e: moves curser to the beginning/end of the input
+ :ctrl d: deletes the character under the cursor
+ :meta d: deletes everything from the cursor to the end of the next word
+ :meta delete/backspace ctrl w: deletes everything from the cursor to the beginning of the current word
+ :ctrl k: deletes everything from the cursor to the end of the input
+ :ctrl u: deletes everything from the cursor to the beginning of the input
"""
def __init__(self, completer, on_exit,
on_error=None,
@@ -160,7 +167,7 @@ class CompleteEdit(urwid.Edit):
self.on_exit(self.edit_text)
elif key == 'esc':
self.on_exit(None)
- elif key == 'ctrl a':
+ elif key in ('ctrl a', 'ctrl b'):
self.set_edit_pos(0)
elif key == 'ctrl e':
self.set_edit_pos(len(self.edit_text))
@@ -170,12 +177,15 @@ class CompleteEdit(urwid.Edit):
self.set_edit_pos(max(self.edit_pos-1, 0))
elif key == 'ctrl k':
self.edit_text = self.edit_text[:self.edit_pos]
+ elif key == 'ctrl u':
+ self.edit_text = self.edit_text[self.edit_pos:]
+ self.set_edit_pos(0)
elif key == 'ctrl d':
self.edit_text = (self.edit_text[:self.edit_pos] +
self.edit_text[self.edit_pos+1:])
- elif key == 'meta f':
+ elif key in ('meta f', 'shift right'):
self.move_to_next_word(forward=True)
- elif key == 'meta b':
+ elif key in ('meta b', 'shift left'):
self.move_to_next_word(forward=False)
elif key == 'meta d':
start_pos = self.edit_pos
@@ -184,7 +194,7 @@ class CompleteEdit(urwid.Edit):
self.edit_text = (self.edit_text[:start_pos] +
self.edit_text[end_pos:])
self.set_edit_pos(start_pos)
- elif key == 'meta backspace':
+ elif key in ('meta delete', 'meta backspace', 'ctrl w'):
end_pos = self.edit_pos
start_pos = self.move_to_next_word(forward=False)
if start_pos != None: