diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2013-02-23 18:34:15 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2013-03-03 13:48:21 +0000 |
commit | ff693c8789404b150b46de3b353ab0d3a6e74594 (patch) | |
tree | 37aec835cb8bc6ed0c589d8b32d1fc0d9283c8d6 /alot | |
parent | 0859a960f620e7df879c7bbf92d51fd15b606b44 (diff) |
make MoveCommand interpret 'first' direction
with this, one can get the familiar 'gg' behaviour from vim: just bind
'g g' = move first
cf issue #532
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/globals.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py index eee6a7c0..ba577714 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -786,7 +786,7 @@ class ComposeCommand(Command): @registerCommand(MODE, 'move', help='move focus in current buffer', arguments=[(['movement'], { 'nargs':argparse.REMAINDER, - 'help':'up, down, page up, page down'})]) + 'help':'up, down, page up, page down, first'})]) class MoveCommand(Command): """move in widget""" def __init__(self, movement=None, **kwargs): @@ -799,6 +799,8 @@ class MoveCommand(Command): def apply(self, ui): if self.movement in ['up', 'down', 'page up', 'page down']: ui.mainloop.process_input([self.movement]) + elif self.movement == 'first': + ui.current_buffer.focus_first() else: ui.notify('unknown movement: ' + self.movement, priority='error') |