Skip to content

Commit

Permalink
rename wgetnstr to get_todo
Browse files Browse the repository at this point in the history
  • Loading branch information
mecaneer23 committed Dec 12, 2023
1 parent 39f3e65 commit 4e70260
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/get_todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/menus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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],
Expand Down
5 changes: 2 additions & 3 deletions todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
- fix silence if dependencies are not installed

0 comments on commit 4e70260

Please sign in to comment.