Skip to content

Commit

Permalink
fix type hints in color_menu
Browse files Browse the repository at this point in the history
  • Loading branch information
mecaneer23 committed Oct 10, 2023
1 parent cb111c5 commit 18ccec1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def color_menu(parent_win: Any, original: int) -> int:
(parent_win.getmaxyx()[1] - (len(lines[0]) + 1)) // 2,
)
win.box()
move_options = {
move_options: dict[int, tuple[str, Callable[[int], int]]] = {
107: ("k", lambda cursor: cursor - 1),
106: ("j", lambda cursor: cursor + 1),
103: ("g", lambda _: 0),
Expand Down Expand Up @@ -245,11 +245,11 @@ def color_menu(parent_win: Any, original: int) -> int:
10: ("enter", lambda: get_color(lines[cursor].strip())),
}
if key in move_options:
_, func = move_options[key]
cursor = func(cursor)
_, move_func = move_options[key]
cursor = move_func(cursor)
elif key in return_options:
_, func = return_options[key]
return func()
_, return_func = return_options[key]
return return_func()
else:
continue
cursor = clamp(cursor, 0, len(lines))
Expand Down

0 comments on commit 18ccec1

Please sign in to comment.