mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-11 09:52:13 +03:00
Fix parsing of + as a shortcut
This commit is contained in:
parent
f0e7d26409
commit
5c2056a7cb
9
kitty/key_encoding.py
generated
9
kitty/key_encoding.py
generated
@ -174,7 +174,7 @@ class EventType(IntEnum):
|
||||
|
||||
@lru_cache(maxsize=128)
|
||||
def parse_shortcut(spec: str) -> ParsedShortcut:
|
||||
if spec.endswith('+') and len(spec) > 1:
|
||||
if spec.endswith('+'):
|
||||
spec = spec[:-1] + 'plus'
|
||||
parts = spec.split('+')
|
||||
key_name = parts[-1]
|
||||
@ -184,10 +184,11 @@ def parse_shortcut(spec: str) -> ParsedShortcut:
|
||||
key_name = key_name.upper()
|
||||
else:
|
||||
key_name = character_key_name_aliases.get(key_name.upper(), key_name)
|
||||
mods = tuple(config_mod_map.get(x.upper(), SUPER << 8) for x in parts[:-1])
|
||||
mod_val = 0
|
||||
for x in mods:
|
||||
mod_val |= x
|
||||
if len(parts) > 1:
|
||||
mods = tuple(config_mod_map.get(x.upper(), SUPER << 8) for x in parts[:-1])
|
||||
for x in mods:
|
||||
mod_val |= x
|
||||
return ParsedShortcut(mod_val, key_name)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user