mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 10:41:58 +02:00
Fix a couple of tests
This commit is contained in:
@@ -22,7 +22,7 @@ def get_shortcut(keymap: KeyMap, ev: KeyEvent) -> Optional[List[KeyDefinition]]:
|
|||||||
@overload
|
@overload
|
||||||
def get_shortcut(keymap: SequenceMap, ev: KeyEvent) -> Optional[SubSequenceMap]: ...
|
def get_shortcut(keymap: SequenceMap, ev: KeyEvent) -> Optional[SubSequenceMap]: ...
|
||||||
|
|
||||||
def get_shortcut(keymap: Union[KeyMap | SequenceMap], ev: KeyEvent) -> Union[List[KeyDefinition] | SubSequenceMap | None]:
|
def get_shortcut(keymap: Union[KeyMap, SequenceMap], ev: KeyEvent) -> Union[List[KeyDefinition], SubSequenceMap, None]:
|
||||||
mods = ev.mods & mod_mask
|
mods = ev.mods & mod_mask
|
||||||
ans = keymap.get(SingleKey(mods, False, ev.key))
|
ans = keymap.get(SingleKey(mods, False, ev.key))
|
||||||
if ans is None and ev.shifted_key and mods & GLFW_MOD_SHIFT:
|
if ans is None and ev.shifted_key and mods & GLFW_MOD_SHIFT:
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ class TestConfParsing(BaseTest):
|
|||||||
return ans
|
return ans
|
||||||
|
|
||||||
def keys_for_func(opts, name):
|
def keys_for_func(opts, name):
|
||||||
for key, defn in opts.keymap.items():
|
for key, defns in opts.keymap.items():
|
||||||
for action in opts.alias_map.resolve_aliases(defn):
|
for action in opts.alias_map.resolve_aliases(defns[0].definition):
|
||||||
if action.func == name:
|
if action.func == name:
|
||||||
yield key
|
yield key
|
||||||
|
|
||||||
@@ -69,8 +69,8 @@ class TestConfParsing(BaseTest):
|
|||||||
self.ae(opts.env, {'A': '1', 'B': 'x1', 'C': '', 'D': DELETE_ENV_VAR})
|
self.ae(opts.env, {'A': '1', 'B': 'x1', 'C': '', 'D': DELETE_ENV_VAR})
|
||||||
|
|
||||||
def ac(which=0):
|
def ac(which=0):
|
||||||
ka = tuple(opts.keymap.values())[0]
|
ka = tuple(opts.keymap.values())[0][0]
|
||||||
acs = opts.alias_map.resolve_aliases(ka)
|
acs = opts.alias_map.resolve_aliases(ka.definition)
|
||||||
return acs[which]
|
return acs[which]
|
||||||
|
|
||||||
ka = ac()
|
ka = ac()
|
||||||
|
|||||||
Reference in New Issue
Block a user