# HG changeset patch
# User Edouard Tisserant <edouard.tisserant@gmail.com>
# Date 1724106705 -7200
# Node ID f1c673cddc1f7f36485cba16b85f87c8957aa9a5
# Parent  d73a477237efd1b6dd598d6a30c24b66bf91ac45
IDE: Fix search result not showing single occurrences

diff -r d73a477237ef -r f1c673cddc1f controls/SearchResultPanel.py
--- a/controls/SearchResultPanel.py	Sun Aug 18 18:23:18 2024 +0200
+++ b/controls/SearchResultPanel.py	Tue Aug 20 00:31:45 2024 +0200
@@ -172,7 +172,7 @@
                 "type": ITEM_PROJECT,
                 "data": None,
                 "text": None,
-                "matches": None,
+                "matches": 0,
             }
             search_results_tree_children = search_results_tree_infos.setdefault("children", [])
             for tagname in self.ElementsOrder:
@@ -291,7 +291,7 @@
             start_idx = start[1]
             end_idx = reduce(lambda x, y: x + y, [len(x) + 1 for x in text_lines[:end[0] - start[0]]], end[1] + 1)
             style = wx.TextAttr(wx.BLACK, wx.Colour(206, 204, 247))
-        elif infos["type"] is not None and infos["matches"] > 1:
+        elif infos["type"] is not None and infos["matches"] > 0:
             text = _("(%d matches)") % infos["matches"]
             start_idx, end_idx = 0, len(text)
             style = wx.TextAttr(wx.Colour(0, 127, 174))