# HG changeset patch # User Laurent Bessard # Date 1355920178 -3600 # Node ID 64aa66d481c5da07c9c48f0753002342fbde95b6 # Parent 6b2958f04f30c862612632f35f7375dfffd81719 Fix bug in resource search result highlighting diff -r 6b2958f04f30 -r 64aa66d481c5 controls/SearchResultPanel.py --- a/controls/SearchResultPanel.py Tue Dec 11 01:19:42 2012 +0100 +++ b/controls/SearchResultPanel.py Wed Dec 19 13:29:38 2012 +0100 @@ -230,6 +230,21 @@ _element_infos["matches"] += len(children) _element_infos["children"].append(element_infos) break + if element_type == ITEM_RESOURCE: + search_results_tree_children.append(element_infos) + else: + _tagname = self.ParentWindow.Controler.ComputePouName(words[1]) + _element_type = self.ParentWindow.Controler.GetPouType(words[1]) + + _element_infos = {"name": words[1], + "type": _element_type, + "data": _tagname, + "text": None, + "matches": 1, + "children": [element_infos]} + + search_results_tree_children.append(_element_infos) + else: search_results_tree_children.append(element_infos) diff -r 6b2958f04f30 -r 64aa66d481c5 editors/ResourceEditor.py --- a/editors/ResourceEditor.py Tue Dec 11 01:19:42 2012 +0100 +++ b/editors/ResourceEditor.py Wed Dec 19 13:29:38 2012 +0100 @@ -458,6 +458,8 @@ event.Skip() def AddHighlight(self, infos, start, end, highlight_type): + EditorPanel.AddHighlight(self, infos, start, end, highlight_type) + if infos[0] == "task": self.TasksTable.AddHighlight(infos[1:], highlight_type) elif infos[0] == "instance":