Don't force-follow hints when typing chars

This commit is contained in:
Florian Bruhin 2018-02-26 20:48:49 +01:00
parent 6fc391986f
commit de3b4adfd8
2 changed files with 10 additions and 3 deletions

View File

@ -909,20 +909,27 @@ class HintManager(QObject):
@cmdutils.register(instance='hintmanager', scope='tab',
modes=[usertypes.KeyMode.hint])
def follow_hint(self, keystring=None):
def follow_hint(self, select=False, keystring=None):
"""Follow a hint.
Args:
select: Only select the given hint, don't necessarily follow it.
keystring: The hint to follow, or None.
"""
if keystring is None:
if self._context.to_follow is None:
raise cmdexc.CommandError("No hint to follow")
elif select:
raise cmdexc.CommandError("Can't use --select without hint.")
else:
keystring = self._context.to_follow
elif keystring not in self._context.labels:
raise cmdexc.CommandError("No hint {}!".format(keystring))
self._fire(keystring)
if select:
self._handle_auto_follow(keystring)
else:
self._fire(keystring)
@pyqtSlot(usertypes.KeyMode)
def on_mode_left(self, mode):

View File

@ -256,7 +256,7 @@ class HintKeyParser(keyparser.CommandKeyParser):
"""
self._read_config()
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:
self._filtertext = ''