--- a/eric6/E5Gui/E5TreeWidget.py Mon Apr 12 19:05:23 2021 +0200 +++ b/eric6/E5Gui/E5TreeWidget.py Mon Apr 12 19:21:40 2021 +0200 @@ -213,12 +213,13 @@ while firstItm: if lFilter in firstItm.text(0).lower(): firstItm.setHidden(False) - elif not firstItm.parent() and not belowItm: + elif ( + not firstItm.parent() and + (not belowItm or not belowItm.parent()) + ): firstItm.setHidden(True) elif not belowItm: break - elif not firstItm.parent() and not belowItm.parent(): - firstItm.setHidden(True) topLvlIndex += 1 firstItm = self.topLevelItem(topLvlIndex)