summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alot/commands/globals.py4
-rw-r--r--alot/ui.py16
2 files changed, 9 insertions, 11 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 3f55bcf2..a04aecef 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -314,8 +314,8 @@ class PythonShellCommand(Command):
class RepeatCommand(Command):
"""Repeats the command executed last time"""
def apply(self, ui):
- if ui.last_command != None:
- ui.apply_command(ui.last_command)
+ if ui.last_commandline is not None:
+ ui.apply_commandline(ui.last_commandline)
else:
ui.notify('no last command')
diff --git a/alot/ui.py b/alot/ui.py
index f04e79ff..6007f8b0 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -10,9 +10,6 @@ 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
@@ -40,8 +37,8 @@ class UI(object):
"""history of the command line prompt"""
input_queue = []
"""stores partial keyboard input"""
- last_command = None
- """saves the last executed command"""
+ last_commandline = None
+ """saves the last executed commandline"""
def __init__(self, dbman, initialcmd):
"""
@@ -174,10 +171,11 @@ 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
+
+ # store cmdline for use with 'repeat' command
+ cmdline = cmdline.lstrip()
+ if not cmdline.startswith('prompt') and not cmdline.startswith('repeat'):
+ self.last_commandline = cmdline
def _unhandeled_input(self, key):
"""