diff --git a/qutebrowser/completion/models/instances.py b/qutebrowser/completion/models/instances.py index c92225539..568607b79 100644 --- a/qutebrowser/completion/models/instances.py +++ b/qutebrowser/completion/models/instances.py @@ -27,8 +27,7 @@ Module attributes: import functools -from qutebrowser.completion.models import (miscmodels, urlmodel, configmodel, - base) +from qutebrowser.completion.models import miscmodels, urlmodel, configmodel from qutebrowser.utils import objreg, usertypes, log, debug from qutebrowser.config import configdata @@ -115,13 +114,6 @@ def init_session_completion(): _instances[usertypes.Completion.sessions] = model -def _init_empty_completion(): - """Initialize empty completion model.""" - log.completion.debug("Initializing empty completion.") - if usertypes.Completion.empty not in _instances: - _instances[usertypes.Completion.empty] = base.BaseCompletionModel() - - INITIALIZERS = { usertypes.Completion.command: _init_command_completion, usertypes.Completion.helptopic: _init_helptopic_completion, @@ -133,7 +125,6 @@ INITIALIZERS = { usertypes.Completion.quickmark_by_name: init_quickmark_completions, usertypes.Completion.bookmark_by_url: init_bookmark_completions, usertypes.Completion.sessions: init_session_completion, - usertypes.Completion.empty: _init_empty_completion, } diff --git a/qutebrowser/config/parsers/keyconf.py b/qutebrowser/config/parsers/keyconf.py index b2596fb62..e8e7cc6dc 100644 --- a/qutebrowser/config/parsers/keyconf.py +++ b/qutebrowser/config/parsers/keyconf.py @@ -152,7 +152,6 @@ class KeyConfigParser(QObject): @cmdutils.register(instance='key-config', maxsplit=1, no_cmd_split=True) @cmdutils.argument('win_id', win_id=True) - @cmdutils.argument('key', completion=usertypes.Completion.empty) @cmdutils.argument('command', completion=usertypes.Completion.command) def bind(self, key, win_id, command=None, *, mode='normal', force=False): """Bind a key to a command. diff --git a/qutebrowser/utils/usertypes.py b/qutebrowser/utils/usertypes.py index 65c3c31e2..1cd1f0385 100644 --- a/qutebrowser/utils/usertypes.py +++ b/qutebrowser/utils/usertypes.py @@ -238,8 +238,7 @@ KeyMode = enum('KeyMode', ['normal', 'hint', 'command', 'yesno', 'prompt', # Available command completions Completion = enum('Completion', ['command', 'section', 'option', 'value', 'helptopic', 'quickmark_by_name', - 'bookmark_by_url', 'url', 'tab', 'sessions', - 'empty']) + 'bookmark_by_url', 'url', 'tab', 'sessions']) # Exit statuses for errors. Needs to be an int for sys.exit. diff --git a/tests/unit/completion/test_completer.py b/tests/unit/completion/test_completer.py index 8e9273a90..f3567674e 100644 --- a/tests/unit/completion/test_completer.py +++ b/tests/unit/completion/test_completer.py @@ -112,7 +112,6 @@ def cmdutils_patch(monkeypatch, stubs): pass @cmdutils.argument('win_id', win_id=True) - @cmdutils.argument('key', completion=usertypes.Completion.empty) @cmdutils.argument('command', completion=usertypes.Completion.command) def bind(key, win_id, command=None, *, mode='normal', force=False): """docstring!""" @@ -171,10 +170,10 @@ def _validate_cmd_prompt(cmd, txt): (':help |', usertypes.Completion.helptopic), (':help |', usertypes.Completion.helptopic), (':open |', usertypes.Completion.url), - (':bind |', usertypes.Completion.empty), + (':bind |', None), (':bind |', usertypes.Completion.command), (':bind foo|', usertypes.Completion.command), - (':bind | foo', usertypes.Completion.empty), + (':bind | foo', None), (':set| general ', usertypes.Completion.command), (':|set general ', usertypes.Completion.command), (':set gene|ral ignore-case', usertypes.Completion.section),