diff options
author | Florian Bruhin <git@the-compiler.org> | 2018-03-09 08:36:37 +0100 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2018-03-09 08:43:07 +0100 |
commit | c7cccf4ba0ae512254f6be72492e8fa9775da39b (patch) | |
tree | 12b57112b3d720bda472690b031f6dff2107e8ed | |
parent | 66b06ed84ce3b383f03d70b7244b3b02726981b5 (diff) | |
download | qutebrowser-c7cccf4ba0ae512254f6be72492e8fa9775da39b.tar.gz qutebrowser-c7cccf4ba0ae512254f6be72492e8fa9775da39b.zip |
Clear key chains when a special key is pressed in hint mode
When we press "s<Escape>", we don't want <Escape> to be handled as part of a key
chain.
-rw-r--r-- | qutebrowser/keyinput/modeparsers.py | 13 |
1 files 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 |