From 0c439200f4fdf57a5c48bc67bea1d193923f5f57 Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison Date: Sat, 18 Feb 2023 12:42:12 -0800 Subject: [PATCH] Track found entry count and remove incorrect modified stat logic --- jrnl/controller.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/jrnl/controller.py b/jrnl/controller.py index c63b88ac..7b3ee910 100644 --- a/jrnl/controller.py +++ b/jrnl/controller.py @@ -85,13 +85,13 @@ def run(args: "Namespace"): # If not append mode, then we're in search mode (only 2 modes exist) search_mode(**kwargs) - _print_entries_found_count(len(journal), args) + entries_found_count = len(journal) + _print_entries_found_count(entries_found_count, args) # Actions _perform_actions_on_search_results(**kwargs) - - if len(journal.entries) != 0 and _has_action_args(args): + if entries_found_count != 0 and _has_action_args(args): _print_edited_summary(journal, old_stats) else: # display only occurs if no other action occurs @@ -328,7 +328,6 @@ def _print_edited_summary( "deleted": old_stats["count"] - len(journal), "modified": len([e for e in journal.entries if e.modified]), } - stats["modified"] -= stats["added"] msgs = [] if stats["added"] > 0: