From d57e60f76aba724e35a8dc83963879d7658192e8 Mon Sep 17 00:00:00 2001 From: Piero Lescano <71156605+piero-vic@users.noreply.github.com> Date: Thu, 28 Oct 2021 13:07:03 -0500 Subject: [PATCH] Add added option to _print_edited_summary --- jrnl/jrnl.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jrnl/jrnl.py b/jrnl/jrnl.py index bc7e0b88..696bde09 100644 --- a/jrnl/jrnl.py +++ b/jrnl/jrnl.py @@ -275,13 +275,18 @@ def _edit_search_results(config, journal, old_entries, **kwargs): def _print_edited_summary(journal, old_stats, **kwargs): stats = { + "added": len(journal) - old_stats["count"], "deleted": old_stats["count"] - len(journal), "modified": len([e for e in journal.entries if e.modified]), } prompts = [] - if stats["deleted"]: + if stats["added"] > 0: + prompts.append(f"{stats['added']} {_pluralize_entry(stats['added'])} added") + stats["modified"] -= stats["added"] + + if stats["deleted"] > 0: prompts.append( f"{stats['deleted']} {_pluralize_entry(stats['deleted'])} deleted" )