diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 7fe53cb1e..f47bdabd3 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -788,7 +788,7 @@ How many steps to zoom out. |<>|Select the previous completion item. |<>|Drop selection and keep selection mode enabled. |<>|Enter a key mode. -|<>|Follow the currently selected hint. +|<>|Follow a hint. |<>|Follow the selected text. |<>|Leave the mode we're currently in. |<>|Show an error message in the statusbar. @@ -877,7 +877,12 @@ Enter a key mode. [[follow-hint]] === follow-hint -Follow the currently selected hint. +Syntax: +:follow-hint ['keystring']+ + +Follow a hint. + +==== positional arguments +* +'keystring'+: The hint to follow. [[follow-selected]] === follow-selected diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index 009fc8650..05e21c51c 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -947,11 +947,18 @@ class HintManager(QObject): handler() @cmdutils.register(instance='hintmanager', scope='tab', hide=True) - def follow_hint(self): - """Follow the currently selected hint.""" - if not self._context.to_follow: - raise cmdexc.CommandError("No hint to follow") - self.fire(self._context.to_follow, force=True) + def follow_hint(self, keystring=None): + """Follow a hint. + + Args: + 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") + else: + keystring = self._context.to_follow + self.fire(keystring, force=True) @pyqtSlot('QSize') def on_contents_size_changed(self, _size):