feat: Inform user if no file was written
When the user exits the note-writing editor process without having written any file, we also don't attach an annotation to the corresponding task since it would lead nowhere. This small change makes this condition obvious to the user, by informing them that the program is 'doing nothing' when they exit the editor without having saved a file.
This commit is contained in:
parent
5724c8888d
commit
a088fcbe76
2 changed files with 7 additions and 1 deletions
4
topen.py
4
topen.py
|
|
@ -69,6 +69,8 @@ def main():
|
|||
|
||||
if fpath.exists():
|
||||
add_annotation_if_missing(task, annotation_content=cfg.notes_annot)
|
||||
return
|
||||
whisper("No note file, doing nothing.")
|
||||
|
||||
|
||||
def get_task(id: str | int, data_location: Path) -> Task:
|
||||
|
|
@ -92,7 +94,7 @@ def get_notes_file(uuid: str, notes_dir: Path, notes_ext: str) -> Path:
|
|||
|
||||
def open_editor(file: Path, editor: str) -> None:
|
||||
"""Opens a file with the chosen editor."""
|
||||
_ = whisper(f"Editing note: {file}")
|
||||
whisper(f"Editing note: {file}")
|
||||
_ = subprocess.run(f"{editor} {file}", shell=True)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue