From c7cccf4ba0ae512254f6be72492e8fa9775da39b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 9 Mar 2018 08:36:37 +0100 Subject: Clear key chains when a special key is pressed in hint mode When we press "s", we don't want to be handled as part of a key chain. --- qutebrowser/keyinput/modeparsers.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/qutebrowser/keyinput/modeparsers.py b/qutebrowser/keyinput/modeparsers.py index 1f76138e0..dd9704c87 100644 --- a/qutebrowser/keyinput/modeparsers.py +++ b/qutebrowser/keyinput/modeparsers.py @@ -259,9 +259,18 @@ class HintKeyParser(CommandKeyParser): Returns: True if the match has been handled, False otherwise. """ - match = super().handle(e, dry_run=dry_run) + + dry_run_match = super().handle(e, dry_run=True) if dry_run: - return match + return dry_run_match + + if (not keyutils.is_printable(e.key()) and + dry_run_match == QKeySequence.NoMatch): + log.keyboard.debug("Got special key, clearing keychain") + self.clear_keystring() + + assert not dry_run + match = super().handle(e) if match == QKeySequence.PartialMatch: self._last_press = LastPress.keystring -- cgit v1.2.3-54-g00ecf