mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-24 01:08:10 +02:00
Fix some type errors
This commit is contained in:
@@ -91,7 +91,7 @@ def prepare_config_file_for_editing() -> str:
|
|||||||
return defconf
|
return defconf
|
||||||
|
|
||||||
|
|
||||||
def finalize_keys(opts: Options, alias_map: Dict[str, ActionAlias]) -> None:
|
def finalize_keys(opts: Options, alias_map: Dict[str, List[ActionAlias]]) -> None:
|
||||||
defns: List[KeyDefinition] = []
|
defns: List[KeyDefinition] = []
|
||||||
for d in opts.map:
|
for d in opts.map:
|
||||||
if d is None: # clear_all_shortcuts
|
if d is None: # clear_all_shortcuts
|
||||||
@@ -122,7 +122,7 @@ def finalize_keys(opts: Options, alias_map: Dict[str, ActionAlias]) -> None:
|
|||||||
opts.sequence_map = sequence_map
|
opts.sequence_map = sequence_map
|
||||||
|
|
||||||
|
|
||||||
def finalize_mouse_mappings(opts: Options, alias_map: Dict[str, ActionAlias]) -> None:
|
def finalize_mouse_mappings(opts: Options, alias_map: Dict[str, List[ActionAlias]]) -> None:
|
||||||
defns: List[MouseMapping] = []
|
defns: List[MouseMapping] = []
|
||||||
for d in opts.mouse_map:
|
for d in opts.mouse_map:
|
||||||
if d is None: # clear_all_mouse_actions
|
if d is None: # clear_all_mouse_actions
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class OpenAction(NamedTuple):
|
|||||||
def parse(lines: Iterable[str]) -> Iterator[OpenAction]:
|
def parse(lines: Iterable[str]) -> Iterator[OpenAction]:
|
||||||
match_criteria: List[MatchCriteria] = []
|
match_criteria: List[MatchCriteria] = []
|
||||||
actions: List[KeyAction] = []
|
actions: List[KeyAction] = []
|
||||||
alias_map: Dict[str, ActionAlias] = {}
|
alias_map: Dict[str, List[ActionAlias]] = {}
|
||||||
entries = []
|
entries = []
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
@@ -62,7 +62,7 @@ def parse(lines: Iterable[str]) -> Iterator[OpenAction]:
|
|||||||
match_criteria.append(MatchCriteria(cast(MatchType, key), rest))
|
match_criteria.append(MatchCriteria(cast(MatchType, key), rest))
|
||||||
elif key == 'action_alias':
|
elif key == 'action_alias':
|
||||||
for (alias_name, args) in action_alias(rest):
|
for (alias_name, args) in action_alias(rest):
|
||||||
alias_map[alias_name] = ActionAlias(args[0], args=tuple(args[1:]))
|
alias_map[alias_name] = [ActionAlias(args[0], args=tuple(args[1:]))]
|
||||||
else:
|
else:
|
||||||
log_error(f'Ignoring malformed open actions line: {line}')
|
log_error(f'Ignoring malformed open actions line: {line}')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user