Don't explicitely fill commandline
This commit is contained in:
parent
265019650b
commit
016e8f3c8d
@ -597,11 +597,11 @@ DATA = OrderedDict([
|
|||||||
|
|
||||||
('keybind', sect.ValueList(
|
('keybind', sect.ValueList(
|
||||||
types.KeyBindingName(), types.KeyBinding(),
|
types.KeyBindingName(), types.KeyBinding(),
|
||||||
('o', 'open'),
|
('o', 'set-cmd-text ":open "'),
|
||||||
('go', 'set-cmd-text :open {url}'),
|
('go', 'set-cmd-text :open {url}'),
|
||||||
('O', 'open-tab'),
|
('O', 'set-cmd-text ":open-tab "'),
|
||||||
('gO', 'set-cmd-text :open-tab {url}'),
|
('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}'),
|
('xO', 'set-cmd-text :open-tab-bg {url}'),
|
||||||
('ga', 'open-tab about:blank'),
|
('ga', 'open-tab about:blank'),
|
||||||
('d', 'tab-close'),
|
('d', 'tab-close'),
|
||||||
|
@ -23,8 +23,7 @@ from qutebrowser.keyinput.basekeyparser import BaseKeyParser
|
|||||||
import qutebrowser.utils.message as message
|
import qutebrowser.utils.message as message
|
||||||
|
|
||||||
from qutebrowser.commands.managers import CommandManager
|
from qutebrowser.commands.managers import CommandManager
|
||||||
from qutebrowser.commands.exceptions import (
|
from qutebrowser.commands.exceptions import CommandMetaError, CommandError
|
||||||
ArgumentCountError, CommandMetaError, CommandError)
|
|
||||||
|
|
||||||
|
|
||||||
class CommandKeyParser(BaseKeyParser):
|
class CommandKeyParser(BaseKeyParser):
|
||||||
@ -40,25 +39,12 @@ class CommandKeyParser(BaseKeyParser):
|
|||||||
super().__init__(parent, supports_count, supports_chains)
|
super().__init__(parent, supports_count, supports_chains)
|
||||||
self.commandmanager = CommandManager()
|
self.commandmanager = CommandManager()
|
||||||
|
|
||||||
def _run_or_fill(self, cmdstr, count=None):
|
def execute(self, cmdstr, _keytype, count=None):
|
||||||
"""Run the command in cmdstr or fill the statusbar if args missing.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
cmdstr: The command string.
|
|
||||||
count: Optional command count.
|
|
||||||
"""
|
|
||||||
try:
|
try:
|
||||||
self.commandmanager.run(cmdstr, count=count)
|
self.commandmanager.run(cmdstr, count)
|
||||||
except ArgumentCountError:
|
|
||||||
self._debug_log("Filling statusbar with partial command {}".format(
|
|
||||||
cmdstr))
|
|
||||||
message.set_cmd_text(':{} '.format(cmdstr))
|
|
||||||
except (CommandMetaError, CommandError) as e:
|
except (CommandMetaError, CommandError) as e:
|
||||||
message.error(e, immediately=True)
|
message.error(e, immediately=True)
|
||||||
|
|
||||||
def execute(self, cmdstr, _keytype, count=None):
|
|
||||||
self._run_or_fill(cmdstr, count)
|
|
||||||
|
|
||||||
|
|
||||||
class PassthroughKeyParser(CommandKeyParser):
|
class PassthroughKeyParser(CommandKeyParser):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user