Skip to content

Commit

Permalink
feat: allow internal copy paste operation when pyperclip isn't available
Browse files Browse the repository at this point in the history
  • Loading branch information
mecaneer23 committed Jun 20, 2024
1 parent e4e2836 commit e45fee3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def copy_todo(
if not CLIPBOARD_EXISTS:
alert(
stdscr,
"Copy dependency not available: try running `pip install pyperclip`",
"Copied internally. External copy dependency not "
"available: try running `pip install pyperclip`",
)
return
copy( # pyright: ignore[reportPossiblyUnboundVariable]
Expand All @@ -54,9 +55,11 @@ def _todo_from_clipboard(
) -> Todos:
"""Retrieve copied_todo and insert into todo list"""
if not CLIPBOARD_EXISTS:
todos.insert(selected + 1, Todo(repr(copied_todo)))
alert(
stdscr,
"Paste dependency not available: try running `pip install pyperclip`",
"Pasting from internal buffer. External paste dependency "
"not available: try running `pip install pyperclip`",
)
return todos
pasted = paste() # pyright: ignore
Expand Down

0 comments on commit e45fee3

Please sign in to comment.