mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-21 04:32:05 +00:00
Micro-optimization
This commit is contained in:
parent
0c46783f5e
commit
d3133420ba
1 changed files with 4 additions and 4 deletions
|
|
@ -1395,14 +1395,14 @@ key_map_option_converters['timeout'] = float
|
|||
|
||||
def _convert_allow_fallback(val: str) -> tuple[KeyFallbackType, ...]:
|
||||
match val:
|
||||
case '' | 'none':
|
||||
return ()
|
||||
case 'shifted,ascii':
|
||||
return (KeyFallbackType.shifted, KeyFallbackType.alternate)
|
||||
case 'ascii,shifted':
|
||||
return (KeyFallbackType.alternate, KeyFallbackType.shifted)
|
||||
case 'shifted':
|
||||
return (KeyFallbackType.shifted,)
|
||||
case '' | 'none':
|
||||
return ()
|
||||
case 'ascii,shifted':
|
||||
return (KeyFallbackType.alternate, KeyFallbackType.shifted)
|
||||
case 'ascii':
|
||||
return (KeyFallbackType.alternate,)
|
||||
raise ValueError(f'allow_fallback values must be a subset of shifted, ascii, got: {val}')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue