This commit is contained in:
Argn0 2018-01-10 21:29:31 +01:00
parent 2c4d2beea3
commit 1db4309eec
2 changed files with 4 additions and 23 deletions

View File

@ -740,11 +740,6 @@ completion.use_best_match:
default: false
desc: Execute the best-matching command on a partial match.
completion.exit_prefix:
type: Bool
default: false
desc: Exit command mode if the prefix gets deleted.
## downloads
downloads.location.directory:
@ -2498,4 +2493,5 @@ bindings.commands:
keyboard.
* register: Entered when qutebrowser is waiting for a register name/key for
commands like `:set-mark`.
commands like `:set-mark`.

View File

@ -31,6 +31,7 @@ from qutebrowser.config import config
class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
"""The commandline part of the statusbar.
Attributes:
@ -54,8 +55,6 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
show_cmd = pyqtSignal()
hide_cmd = pyqtSignal()
prefixes = '/ : ?'
def __init__(self, *, win_id, private, parent=None):
misc.CommandLineEdit.__init__(self, parent=parent)
misc.MinimalLineEditMixin.__init__(self)
@ -216,20 +215,6 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
self.clear_completion_selection.emit()
self.hide_completion.emit()
def setText(self, text):
"""Extend setText to set prefix and make sure the prompt is ok."""
if not text:
pass
elif text[0] in modeparsers.STARTCHARS:
if config.val.completion.exit_prefix:
super().set_prompt('')
else:
super().set_prompt(text[0])
else:
raise utils.Unreachable("setText got called with invalid text "
"'{}'!".format(text))
super().setText(text)
def keyPressEvent(self, e):
"""Override keyPressEvent to ignore Return key presses.
@ -267,6 +252,6 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
@pyqtSlot(str)
def _exit_prefix(self, text):
if config.val.completion.exit_prefix and (not text or text[0] not in self.prefixes):
if not text:
modeman.leave(self._win_id, usertypes.KeyMode.command,
'prefix deleted', maybe=True)