Skip to content

Commit

Permalink
refactor: change menu functions to have consistent naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mecaneer23 committed Jan 17, 2024
1 parent 266f60b commit c8c766a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/menus.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def help_menu(parent_win: Any) -> None:
parent_win.clear()


def magnify(stdscr: Any, todos: Todos, selected: Cursor) -> None:
def magnify_menu(stdscr: Any, todos: Todos, selected: Cursor) -> None:
if not FIGLET_FORMAT_EXISTS:
set_header(stdscr, "Magnify dependency not available")
return
Expand Down Expand Up @@ -267,7 +267,7 @@ def get_newwin(stdscr: Any) -> Any:
return curses.newwin(3, max_x * 3 // 4, max_y // 2 - 3, max_x // 8)


def search(stdscr: Any, todos: Todos, selected: Cursor) -> None:
def search_menu(stdscr: Any, todos: Todos, selected: Cursor) -> None:
set_header(stdscr, "Searching...")
stdscr.refresh()
sequence = get_todo(
Expand Down
6 changes: 3 additions & 3 deletions todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from src.get_todo import get_todo
from src.io import file_string_to_todos, read_file, update_file
from src.keys import Key
from src.menus import color_menu, get_newwin, help_menu, magnify, search, sort_menu
from src.menus import color_menu, get_newwin, help_menu, magnify_menu, search_menu, sort_menu
from src.print_todos import print_todos
from src.utils import clamp, set_header

Expand Down Expand Up @@ -513,7 +513,7 @@ def main(stdscr: Any) -> int:
Key.ctrl_x: (single_line_state.toggle, "None"),
Key.escape: (lambda: None, "None"),
Key.minus: (handle_insert_blank_todo, "todos, selected"),
Key.slash: (search, "stdscr, todos, selected"),
Key.slash: (search_menu, "stdscr, todos, selected"),
Key.zero: (handle_digits, f"stdscr, todos, selected, {Key.zero}"),
Key.one: (handle_digits, f"stdscr, todos, selected, {Key.one}"),
Key.two: (handle_digits, f"stdscr, todos, selected, {Key.two}"),
Expand All @@ -528,7 +528,7 @@ def main(stdscr: Any) -> int:
Key.J: (selected.multiselect_down, "len(todos)"),
Key.K: (selected.multiselect_up, "None"),
Key.O: (new_todo_current, "stdscr, todos, int(selected)"),
Key.b: (magnify, "stdscr, todos, selected"),
Key.b: (magnify_menu, "stdscr, todos, selected"),
Key.c: (color_todo, "stdscr, todos, selected"),
Key.d: (handle_delete_todo, "stdscr, todos, selected, copied_todo"),
Key.g: (handle_to_top, "todos, selected"),
Expand Down

0 comments on commit c8c766a

Please sign in to comment.