From 53464dcbab7a76bd3bb068e3e470163b273d66b2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 1 May 2014 19:48:48 +0200 Subject: [PATCH] Fix ambigious keybinding detection. Previously we only checked if the *last* char of the current keychain matches the last char of a binding, which e.g. matched 'la' when we pressed 'ka'. Now we simply check if the binding *starts* with the keychain, which also is easier to do. --- qutebrowser/keyinput/_basekeyparser.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/qutebrowser/keyinput/_basekeyparser.py b/qutebrowser/keyinput/_basekeyparser.py index f2d4a33d2..54284052f 100644 --- a/qutebrowser/keyinput/_basekeyparser.py +++ b/qutebrowser/keyinput/_basekeyparser.py @@ -215,10 +215,7 @@ class BaseKeyParser(QObject): if definitive_match is not None and binding == definitive_match[0]: # We already matched that one continue - if len(binding) < len(cmd_input): - # binding is shorter than cmd_input, so it can't possibly match - continue - elif cmd_input[-1] == binding[len(cmd_input) - 1]: + elif binding.startswith(cmd_input): partial_match = True break if definitive_match is not None and partial_match: