editors/CodeFileEditor.py
branchpython3
changeset 3795 223a91584172
parent 3752 9f6f46dbe3ae
child 3932 62d04933d569
--- a/editors/CodeFileEditor.py	Wed Apr 12 23:02:41 2023 +0200
+++ b/editors/CodeFileEditor.py	Thu Apr 13 22:31:33 2023 +0200
@@ -287,7 +287,13 @@
         doc_end_pos = self.GetLength()
         for section in self.Controler.SECTIONS_NAMES:
             section_comments = self.SectionsComments[section]
-            start_pos, end_pos = self.FindText(0, doc_end_pos, section_comments["comment"])
+            txttofind = section_comments["comment"]
+            results = self.FindText(0, doc_end_pos, txttofind)
+            if wx.VERSION < (4, 1, 0):
+                start_pos = results
+                end_pos = start_pos+len(txttofind)
+            else:
+                start_pos, end_pos = results
             self.StartStyling(start_pos)
             self.SetStyling(end_pos - start_pos, STC_CODE_SECTION)
             self.SetLineState(self.LineFromPosition(start_pos), 1)
@@ -594,7 +600,7 @@
                 highlight_end_pos = self.GetLineEndPosition(end[0] - 1) + end[1] + 2
             self.StartStyling(highlight_start_pos)
             self.SetStyling(highlight_end_pos - highlight_start_pos, highlight_type)
-            self.StartStyling(highlight_end_pos)
+            self.StartStyling(highlight_end_pos, 0x00)
             self.SetStyling(len(self.GetText()) - highlight_end_pos, stc.STC_STYLE_DEFAULT)