From 6762d4eca8ef416b8515903eb1b7c390358e925b Mon Sep 17 00:00:00 2001 From: mecaneer23 Date: Sun, 14 Apr 2024 10:54:55 -0500 Subject: [PATCH] feat: support pasting multiline todos --- src/clipboard.py | 4 +++- todo.txt | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/clipboard.py b/src/clipboard.py index b0801cc..c8e9779 100644 --- a/src/clipboard.py +++ b/src/clipboard.py @@ -56,7 +56,9 @@ def _todo_from_clipboard( todos.insert(selected + 1, Todo(repr(copied_todo))) return todos if "\n" in todo: - alert(stdscr, "Pasting newlines not supported") + todo = todo.strip() + for index, line in enumerate(todo.split("\n"), start=1): + todos.insert(selected + index, Todo(f"- {line}")) return todos todos.insert(selected + 1, Todo(f"- {todo}")) return todos diff --git a/todo.txt b/todo.txt index 4cc5978..0a9f48f 100644 --- a/todo.txt +++ b/todo.txt @@ -2,7 +2,6 @@ -r fix long lines (longer than width // 2 - 1) -r fix moving down onto a toggled line -b feat: implement multiline todos - -b allow multiline paste -b allow multiline print -m fix: make startup faster -m depends on how the program is run, not a huge issue