Revert directory search exemption now that the real navigation bug is fixed - search filters directories again

This commit is contained in:
sarah committed 2026-10-09 13:49:18 +02:00
1 parent a00047e3b9
commit 6b2b35f5da
1 file changed
+8 -6
+8 -6
View File
@@ -1302,12 +1302,14 @@ class Browser(ft.Row):
if self.EntryFilter:
Entries = [Entry for Entry in Entries if self.EntryFilter(Entry)]
if self.Config.ShowSearch and self.SearchText:
# Directories never get filtered out, even if their name doesn't
# match — otherwise typing a search hides the very folders you'd
# need to navigate into to find more, making it impossible to go
# anywhere else while a filter is active (the actual bug report:
# "cannot go into directories if there is a search bar").
Entries = [Entry for Entry in Entries if Entry.is_dir() or self._MatchesSearch(Entry.name)]
# Directories filter by name same as files (feedback: "Search
# doesn't affect directories"). They used to be exempted here as
# a (wrong) fix for "cannot go into directories if there is a
# search bar" — that bug's real cause was Ctrl+F leaving CtrlHeld
# stuck (see _SetShortcutsPaused/_ToggleSearchBar), not this
# filter; with that fixed at the root, there's no reason left to
# keep directories unfilterable.
Entries = [Entry for Entry in Entries if self._MatchesSearch(Entry.name)]
Entries = self._SortEntries(Entries)
self.CurrentEntries = Entries
# A refresh (new/renamed/deleted files) can leave stale paths in the