editors/TextViewer.py
branchpython3
changeset 3791 c98646b1c981
parent 3765 88fe6fc9fd38
child 3795 223a91584172
--- a/editors/TextViewer.py	Tue Feb 21 12:47:18 2023 +0800
+++ b/editors/TextViewer.py	Wed Apr 12 19:28:37 2023 +0200
@@ -191,8 +191,12 @@
     def Colourise(self, start, end):
         self.Editor.Colourise(start, end)
 
-    def StartStyling(self, pos):
-        self.Editor.StartStyling(pos)
+    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)
 
     INDIC0 = 0
     INDIC1 = 1
@@ -977,6 +981,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)
+                self.StartStyling(highlight_start_pos, 0x00)
                 until_end = max(0, len(self.Editor.GetText()) - highlight_end_pos)
                 self.SetStyling(until_end, wx.stc.STC_STYLE_DEFAULT)