From d341f3240c31bb7467651e331df140bde8e5f6cc Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison Date: Sat, 18 Feb 2023 12:19:08 -0800 Subject: [PATCH] Don't show summary if no entries found and prevent extra line break when no entries found by short-circuiting display method --- jrnl/controller.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jrnl/controller.py b/jrnl/controller.py index 5d216520..c63b88ac 100644 --- a/jrnl/controller.py +++ b/jrnl/controller.py @@ -90,7 +90,8 @@ def run(args: "Namespace"): # Actions _perform_actions_on_search_results(**kwargs) - if _has_action_args(args): + + if len(journal.entries) != 0 and _has_action_args(args): _print_edited_summary(journal, old_stats) else: # display only occurs if no other action occurs @@ -395,6 +396,9 @@ def _change_time_search_results( def _display_search_results(args: "Namespace", journal: "Journal", **kwargs) -> None: + if len(journal.entries) == 0: + return + # Get export format from config file if not provided at the command line args.export = args.export or kwargs["config"].get("display_format")