From b9c1969126bc772a4ec34b56cd0de9b6fc4e44f5 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 11 Apr 2011 15:12:50 +0200 Subject: Drop empty notes after editing. Keeping empty notes doesn't make sense here. Also, there doesn't seem to be a simple way to erase notes yet. This will make calcurse delete any notes that are empty (meaning that they are either 0-byte files or contain nothing but a newline character) when returning from the editor. Signed-off-by: Lukas Fleischer --- src/todo.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/todo.c') diff --git a/src/todo.c b/src/todo.c index 4076510..125b128 100644 --- a/src/todo.c +++ b/src/todo.c @@ -503,6 +503,9 @@ todo_edit_note (char *editor) } (void)snprintf (fullname, BUFSIZ, "%s%s", path_notes, i->note); wins_launch_external (fullname, editor); + + if (io_file_is_empty (fullname)) + erase_note (&i->note, ERASE_FORCE); } /* View a note previously attached to a todo */ -- cgit v1.2.3-54-g00ecf