From 016e8f3c8d3f65eda2950ac63dc1c6e09475288a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 29 Jul 2014 01:04:17 +0200 Subject: [PATCH] Don't explicitely fill commandline --- qutebrowser/config/configdata.py | 6 +++--- qutebrowser/keyinput/keyparser.py | 20 +++----------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index fbac47c89..9adad19ec 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -597,11 +597,11 @@ DATA = OrderedDict([ ('keybind', sect.ValueList( types.KeyBindingName(), types.KeyBinding(), - ('o', 'open'), + ('o', 'set-cmd-text ":open "'), ('go', 'set-cmd-text :open {url}'), - ('O', 'open-tab'), + ('O', 'set-cmd-text ":open-tab "'), ('gO', 'set-cmd-text :open-tab {url}'), - ('xo', 'open-tab-bg'), + ('xo', 'set-cmd-text ":open-tab-bg "'), ('xO', 'set-cmd-text :open-tab-bg {url}'), ('ga', 'open-tab about:blank'), ('d', 'tab-close'), diff --git a/qutebrowser/keyinput/keyparser.py b/qutebrowser/keyinput/keyparser.py index 6da3eb632..5d4a81f0a 100644 --- a/qutebrowser/keyinput/keyparser.py +++ b/qutebrowser/keyinput/keyparser.py @@ -23,8 +23,7 @@ from qutebrowser.keyinput.basekeyparser import BaseKeyParser import qutebrowser.utils.message as message from qutebrowser.commands.managers import CommandManager -from qutebrowser.commands.exceptions import ( - ArgumentCountError, CommandMetaError, CommandError) +from qutebrowser.commands.exceptions import CommandMetaError, CommandError class CommandKeyParser(BaseKeyParser): @@ -40,25 +39,12 @@ class CommandKeyParser(BaseKeyParser): super().__init__(parent, supports_count, supports_chains) self.commandmanager = CommandManager() - def _run_or_fill(self, cmdstr, count=None): - """Run the command in cmdstr or fill the statusbar if args missing. - - Args: - cmdstr: The command string. - count: Optional command count. - """ + def execute(self, cmdstr, _keytype, count=None): try: - self.commandmanager.run(cmdstr, count=count) - except ArgumentCountError: - self._debug_log("Filling statusbar with partial command {}".format( - cmdstr)) - message.set_cmd_text(':{} '.format(cmdstr)) + self.commandmanager.run(cmdstr, count) except (CommandMetaError, CommandError) as e: message.error(e, immediately=True) - def execute(self, cmdstr, _keytype, count=None): - self._run_or_fill(cmdstr, count) - class PassthroughKeyParser(CommandKeyParser):