Fix protected-access for last_command (not sure what to do for _modes and _not_modes)

This commit is contained in:
Jan Verbeek 2016-06-27 18:40:47 +02:00
parent 81f25251a5
commit 7a6d26ef86
2 changed files with 6 additions and 6 deletions

View File

@ -1981,8 +1981,8 @@ class CommandDispatcher:
Args:
count: Which numeric argument to give the command.
"""
if runners._last_command is None:
if runners.last_command is None:
raise cmdexc.CommandError("You didn't do anything yet.")
runners.CommandRunner(self._win_id).run(
runners._last_command[0],
count if count is not None else runners._last_command[1])
runners.last_command[0],
count if count is not None else runners.last_command[1])

View File

@ -32,7 +32,7 @@ from qutebrowser.misc import split
ParseResult = collections.namedtuple('ParseResult', ['cmd', 'args', 'cmdline',
'count'])
_last_command = None
last_command = None
def _current_url(tabbed_browser):
@ -291,8 +291,8 @@ class CommandRunner(QObject):
usertypes.KeyMode.normal in result.cmd._modes) and
(result.cmd._not_modes is None or
usertypes.KeyMode.normal not in result.cmd._not_modes)):
global _last_command
_last_command = (text, count)
global last_command
last_command = (text, count)
@pyqtSlot(str, int)
@pyqtSlot(str)