diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-04-11 15:12:50 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-04-12 12:02:23 +0200 |
commit | b9c1969126bc772a4ec34b56cd0de9b6fc4e44f5 (patch) | |
tree | e148be2f9d6ca6fd487634b86dce77d5c069ce7c /src/day.c | |
parent | 1140feaabf7bf826b52d21643885fb1bd94702ed (diff) | |
download | calcurse-b9c1969126bc772a4ec34b56cd0de9b6fc4e44f5.zip |
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 <calcurse@cryptocrack.de>
Diffstat (limited to 'src/day.c')
-rw-r--r-- | src/day.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1085,6 +1085,9 @@ day_edit_note (char *editor) (void)snprintf (fullname, BUFSIZ, "%s%s", path_notes, p->note); wins_launch_external (fullname, editor); + if (io_file_is_empty (fullname)) + erase_note (&p->note, ERASE_FORCE); + date = calendar_get_slctd_day_sec (); switch (p->type) { |