Don't force-follow hints when typing chars
This commit is contained in:
parent
6fc391986f
commit
de3b4adfd8
@ -909,19 +909,26 @@ class HintManager(QObject):
|
|||||||
|
|
||||||
@cmdutils.register(instance='hintmanager', scope='tab',
|
@cmdutils.register(instance='hintmanager', scope='tab',
|
||||||
modes=[usertypes.KeyMode.hint])
|
modes=[usertypes.KeyMode.hint])
|
||||||
def follow_hint(self, keystring=None):
|
def follow_hint(self, select=False, keystring=None):
|
||||||
"""Follow a hint.
|
"""Follow a hint.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
select: Only select the given hint, don't necessarily follow it.
|
||||||
keystring: The hint to follow, or None.
|
keystring: The hint to follow, or None.
|
||||||
"""
|
"""
|
||||||
if keystring is None:
|
if keystring is None:
|
||||||
if self._context.to_follow is None:
|
if self._context.to_follow is None:
|
||||||
raise cmdexc.CommandError("No hint to follow")
|
raise cmdexc.CommandError("No hint to follow")
|
||||||
|
elif select:
|
||||||
|
raise cmdexc.CommandError("Can't use --select without hint.")
|
||||||
else:
|
else:
|
||||||
keystring = self._context.to_follow
|
keystring = self._context.to_follow
|
||||||
elif keystring not in self._context.labels:
|
elif keystring not in self._context.labels:
|
||||||
raise cmdexc.CommandError("No hint {}!".format(keystring))
|
raise cmdexc.CommandError("No hint {}!".format(keystring))
|
||||||
|
|
||||||
|
if select:
|
||||||
|
self._handle_auto_follow(keystring)
|
||||||
|
else:
|
||||||
self._fire(keystring)
|
self._fire(keystring)
|
||||||
|
|
||||||
@pyqtSlot(usertypes.KeyMode)
|
@pyqtSlot(usertypes.KeyMode)
|
||||||
|
@ -256,7 +256,7 @@ class HintKeyParser(keyparser.CommandKeyParser):
|
|||||||
"""
|
"""
|
||||||
self._read_config()
|
self._read_config()
|
||||||
self.bindings.update({keyutils.KeySequence.parse(s):
|
self.bindings.update({keyutils.KeySequence.parse(s):
|
||||||
'follow-hint ' + s for s in strings})
|
'follow-hint -s ' + s for s in strings})
|
||||||
if not preserve_filter:
|
if not preserve_filter:
|
||||||
self._filtertext = ''
|
self._filtertext = ''
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user