diff --git a/jrnl/jrnl.py b/jrnl/jrnl.py index c79d46e0..601c146d 100644 --- a/jrnl/jrnl.py +++ b/jrnl/jrnl.py @@ -146,6 +146,9 @@ def write_mode(args: "Namespace", config: dict, journal: Journal, **kwargs) -> N if not raw or raw.isspace(): logging.error("Write mode: couldn't get raw text or entry was empty") raise JrnlException(Message(MsgText.NoTextReceived, MsgStyle.NORMAL)) + if config["template"] and raw == _get_editor_template(config): + logging.error("Write mode: raw text was the same as the template") + raise JrnlException(Message(MsgText.NoChangesToTemplate, MsgStyle.NORMAL)) logging.debug( 'Write mode: appending raw text to journal "%s": %s', args.journal_name, raw diff --git a/jrnl/messages/MsgText.py b/jrnl/messages/MsgText.py index 8bcb7695..c090d985 100644 --- a/jrnl/messages/MsgText.py +++ b/jrnl/messages/MsgText.py @@ -156,7 +156,9 @@ class MsgText(Enum): NoTextReceived = """ No entry to save, because no text was received """ - + NoChangesToTemplate = """ + No entry to save, because the template was not changed + """ # --- Upgrade --- # JournalFailedUpgrade = """ The following journal{s} failed to upgrade: