Skip to content

Commit

Permalink
Add simple trick to show all entries: allow searching for whitespace …
Browse files Browse the repository at this point in the history
…(which should be part of all days).
  • Loading branch information
jendrikseipp committed Nov 10, 2024
1 parent b90e83d commit 7c9579b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 2.36 (unreleased)
* When searching for hashtags, show remainder of line after hashtag in search results (@jendrikseipp).
* When searching for a hashtag, scroll to hashtag and highlight it. (@jendrikseipp).
* Add simple trick to show all entries: allow searching for whitespace (which should be part of all days) (@jendrikseipp).

# 2.35 (2024-09-22)
* Add option to auto-indent text in editor and activate it by default (#561, #562, Allen Benter, Varunjay Varma).
Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ status.
- [ ] Use separate file for storing CSS to allow users to override styles more easily.
- [ ] Make default CSS prettier.
- [ ] Allow searching for days that contain *multiple* words or tags.
- [ ] Add simple way to show all entries: allow searching for whitespace (i.e., don't strip whitespace from search string).
- [X] Add simple way to show all entries: allow searching for whitespace (i.e., don't strip whitespace from search string).
- [ ] Copy files and pictures into data subdirectory (#163, #469).
- [ ] Require minimum width for calendar panel to avoid hiding it by accident.

Expand Down
4 changes: 3 additions & 1 deletion rednotebook/gui/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ def search(self, search_text):
tags.append(part.lstrip("#").lower())
else:
queries.append(part)
# Preserve original white space if there are no tags.
query = " ".join(queries) if tags else search_text

self.main_window.search_tree_view.update_data(" ".join(queries), tags)
self.main_window.search_tree_view.update_data(query, tags)

# Without the following, showing the search results sometimes lets the
# search entry lose focus and search phrases are added to a day's text.
Expand Down

0 comments on commit 7c9579b

Please sign in to comment.