summaryrefslogtreecommitdiff
path: root/alot/ui.py
diff options
context:
space:
mode:
authorChristopher Schwardt <nookieman@gmx.de>2012-11-07 22:49:03 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2013-02-19 18:43:16 +0000
commite823e47b150aff4a1939e8cfddefebf699ab301d (patch)
tree2efe04e17eaa462362c19947c715369ce3cf8f3d /alot/ui.py
parentecf5a504019b8ed57a903332e6f256225519297e (diff)
add repeat command to make the same action again
The UI object now saves the last executed command (except for RepeatCommands themselves and Promt- and FlushCommands, since they are not user invoked, intended actions). The RepeatCommand then applies the stored command again. This is comparable to the . in vim, so I would recommend you add this line to your config ;) . = repeat
Diffstat (limited to 'alot/ui.py')
-rw-r--r--alot/ui.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/alot/ui.py b/alot/ui.py
index 68f9bf15..f04e79ff 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -10,6 +10,9 @@ from buffers import BufferlistBuffer
from commands import commandfactory
from alot.commands import CommandParseError
from alot.commands.globals import CommandSequenceCommand
+from alot.commands.globals import FlushCommand
+from alot.commands.globals import PromptCommand
+from alot.commands.globals import RepeatCommand
from alot.helper import string_decode
from alot.helper import split_commandline
from alot.widgets.globals import CompleteEdit
@@ -37,6 +40,8 @@ class UI(object):
"""history of the command line prompt"""
input_queue = []
"""stores partial keyboard input"""
+ last_command = None
+ """saves the last executed command"""
def __init__(self, dbman, initialcmd):
"""
@@ -169,6 +174,10 @@ class UI(object):
else:
cmd = CommandSequenceCommand(cmdlist)
self.apply_command(cmd)
+ if not isinstance(cmd, RepeatCommand) and \
+ not isinstance(cmd, PromptCommand) and \
+ not isinstance(cmd, FlushCommand):
+ self.last_command = cmd
def _unhandeled_input(self, key):
"""