diff --git a/src/get_todo.py b/src/get_todo.py index 31fb7fe..1f41c16 100644 --- a/src/get_todo.py +++ b/src/get_todo.py @@ -248,7 +248,7 @@ def set_once(mode: SingleLineModeImpl, chars: list[str]) -> str: return two_lines[0] -def wgetnstr( +def get_todo( stdscr: Any, win: Any, todo: Todo, diff --git a/src/menus.py b/src/menus.py index 162e9f8..13471d9 100644 --- a/src/menus.py +++ b/src/menus.py @@ -22,7 +22,7 @@ HELP_FILE, TKINTER_GUI, ) -from src.get_todo import hline, wgetnstr +from src.get_todo import hline, get_todo from src.io import update_file from src.keys import Key from src.md_to_py import md_table_to_lines @@ -277,7 +277,7 @@ def get_newwin(stdscr: Any) -> Any: def search(stdscr: Any, todos: list[Todo], selected: Cursor) -> None: set_header(stdscr, "Searching...") stdscr.refresh() - sequence = wgetnstr( + sequence = get_todo( stdscr, get_newwin(stdscr), Todo(), diff --git a/todo.py b/todo.py index f73451d..30d319a 100755 --- a/todo.py +++ b/todo.py @@ -25,7 +25,7 @@ NO_GUI, TKINTER_GUI, ) -from src.get_todo import set_header, wgetnstr +from src.get_todo import set_header, 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 @@ -52,7 +52,7 @@ def insert_todo( default_todo: Todo = Todo(), mode: SingleLineModeImpl = SingleLineModeImpl(SingleLineMode.NONE), ) -> list[Todo]: - todo = wgetnstr( + todo = get_todo( stdscr, get_newwin(stdscr), todo=default_todo, @@ -167,7 +167,7 @@ def edit_todo(stdscr: Any, todos: list[Todo], selected: int) -> list[Todo]: max(max_x * 3 // 4, len(todo) + 3) if len(todo) < max_x - 1 else max_x * 3 // 4 ) begin_x = max_x // 8 if len(todo) < max_x - 1 - ncols else (max_x - ncols) // 2 - edited_todo = wgetnstr( + edited_todo = get_todo( stdscr, curses.newwin(3, ncols, max_y // 2 - 3, begin_x), todo=todos[selected], diff --git a/todo.txt b/todo.txt index 1a69d93..e9bb120 100644 --- a/todo.txt +++ b/todo.txt @@ -8,7 +8,6 @@ -4 implement multiline todos -4 allow multiline paste -4 allow multiline print - -4 allow wgetnstr to use multiline editing + -4 allow get_todo to use multiline editing - make startup faster -- fix silence if dependencies are not installed -- rename wgetnstr to get_todo \ No newline at end of file +- fix silence if dependencies are not installed \ No newline at end of file