mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-26 02:41:54 +00:00
Fix a couple of tests
This commit is contained in:
parent
f11f770011
commit
716bf714db
2 changed files with 5 additions and 5 deletions
|
|
@ -22,7 +22,7 @@ def get_shortcut(keymap: KeyMap, ev: KeyEvent) -> Optional[List[KeyDefinition]]:
|
|||
@overload
|
||||
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
|
||||
ans = keymap.get(SingleKey(mods, False, ev.key))
|
||||
if ans is None and ev.shifted_key and mods & GLFW_MOD_SHIFT:
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ class TestConfParsing(BaseTest):
|
|||
return ans
|
||||
|
||||
def keys_for_func(opts, name):
|
||||
for key, defn in opts.keymap.items():
|
||||
for action in opts.alias_map.resolve_aliases(defn):
|
||||
for key, defns in opts.keymap.items():
|
||||
for action in opts.alias_map.resolve_aliases(defns[0].definition):
|
||||
if action.func == name:
|
||||
yield key
|
||||
|
||||
|
|
@ -69,8 +69,8 @@ class TestConfParsing(BaseTest):
|
|||
self.ae(opts.env, {'A': '1', 'B': 'x1', 'C': '', 'D': DELETE_ENV_VAR})
|
||||
|
||||
def ac(which=0):
|
||||
ka = tuple(opts.keymap.values())[0]
|
||||
acs = opts.alias_map.resolve_aliases(ka)
|
||||
ka = tuple(opts.keymap.values())[0][0]
|
||||
acs = opts.alias_map.resolve_aliases(ka.definition)
|
||||
return acs[which]
|
||||
|
||||
ka = ac()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue