Skip to content

Commit a7a829f

Browse files
committed
If all words are date-matching, don't search in text
1 parent a4287cd commit a7a829f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rednotebook/data.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ def search(self, words, tags):
208208
# this date.
209209
words.remove(word)
210210
results.append(get_text_with_dots(self.text, 0, TEXT_RESULT_LENGTH))
211+
# if all the words matched agains the date, return
212+
if not words:
213+
return str(self), words
211214
text_result = self.search_in_text(words)
212215
if text_result:
213216
results.append(text_result)

0 commit comments

Comments
 (0)