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.
This commit is contained in:
Florian Bruhin 2014-05-01 19:48:48 +02:00
parent 7aef865b0d
commit 53464dcbab

View File

@ -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: