From 044bc64f0bd8e35fa12a58826c53f5b989cceb74 Mon Sep 17 00:00:00 2001 From: Ricardo Ruiz Date: Fri, 10 May 2024 00:13:30 +0200 Subject: [PATCH] Solved issue #1877 "-and" flag with multiple instances of the -contains option. --- jrnl/journals/Journal.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/jrnl/journals/Journal.py b/jrnl/journals/Journal.py index 27b8505c..cac154ba 100644 --- a/jrnl/journals/Journal.py +++ b/jrnl/journals/Journal.py @@ -298,7 +298,16 @@ class Journal: and ( not contains or ( - any( + strict + and all( + substring in entry.title.casefold() + or substring in entry.body.casefold() + for substring in contains_lower + ) + ) + or ( + not strict + and any( substring in entry.title.casefold() or substring in entry.body.casefold() for substring in contains_lower