editors/TextViewer.py
branchpython3
changeset 3795 223a91584172
parent 3791 c98646b1c981
--- a/editors/TextViewer.py	Wed Apr 12 23:02:41 2023 +0200
+++ b/editors/TextViewer.py	Thu Apr 13 22:31:33 2023 +0200
@@ -191,12 +191,8 @@
     def Colourise(self, start, end):
         self.Editor.Colourise(start, end)
 
-    if wx.VERSION < (4, 1, 0):
-        def StartStyling(self, pos, mask=0xff):
-            self.Editor.StartStyling(pos, mask)
-    else:
-        def StartStyling(self, pos, *ignored):
-            self.Editor.StartStyling(pos)
+    def StartStyling(self, *a, **k):
+        self.Editor.StartStyling(*a, **k)
 
     INDIC0 = 0
     INDIC1 = 1
@@ -981,6 +977,6 @@
             if highlight_start_pos < end_pos and highlight_end_pos > start_pos:
                 self.StartStyling(highlight_start_pos)
                 self.SetStyling(highlight_end_pos - highlight_start_pos, highlight_type)
-                self.StartStyling(highlight_start_pos, 0x00)
+                self.StartStyling(highlight_end_pos, 0x00)
                 until_end = max(0, len(self.Editor.GetText()) - highlight_end_pos)
                 self.SetStyling(until_end, wx.stc.STC_STYLE_DEFAULT)