diff options
-rw-r--r-- | ranger/container/keymap.py | 7 | ||||
-rw-r--r-- | test/tc_newkeys.py | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/ranger/container/keymap.py b/ranger/container/keymap.py index 41875cb2..dee54430 100644 --- a/ranger/container/keymap.py +++ b/ranger/container/keymap.py @@ -295,6 +295,7 @@ special_keys = { } for char in ascii_lowercase: special_keys['c-' + char] = ord(char) - 96 + special_keys['a-' + char] = (27, ord(char)) def translate_keys(obj): """ @@ -318,12 +319,16 @@ def translate_keys(obj): in_brackets = False string = ''.join(bracket_content).lower() try: - yield special_keys[string] + keys = special_keys[string] + for key in keys: + yield key except KeyError: yield ord('<') for c in bracket_content: yield ord(c) yield ord('>') + except TypeError: + yield keys # it was no tuple, just an int else: bracket_content.append(char) else: diff --git a/test/tc_newkeys.py b/test/tc_newkeys.py index bcf08e5f..bbfc74e9 100644 --- a/test/tc_newkeys.py +++ b/test/tc_newkeys.py @@ -136,6 +136,8 @@ class Test(PressTestCase): test('<C-b>', 2) for i in range(1, 26): test('<C-' + chr(i+ord('a')-1) + '>', i) + test('<A-x>', 27, ord('x')) + test('<a-o>', 27, ord('o')) test('k<a') test('k<anz>') test('k<a<nz>') |