fix highlighting error and warning messages with non-lating characters
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Tue, 08 Nov 2016 18:14:30 +0300
changeset 1564 8ffd0b52c2c7
parent 1563 584b6fdb949e
child 1565 894f31f8ca64
fix highlighting error and warning messages with non-lating characters
Beremiz.py
--- a/Beremiz.py	Tue Nov 08 18:06:30 2016 +0300
+++ b/Beremiz.py	Tue Nov 08 18:14:30 2016 +0300
@@ -248,12 +248,14 @@
                 # adding text. It seems that text modifications, even
                 # programmatically, are disabled in StyledTextCtrl when read
                 # only is active
+                start_pos = self.output.GetLength()
                 self.output.SetReadOnly(False)
                 self.output.AppendText(s)
                 self.output.SetReadOnly(True)
+                text_len = self.output.GetLength() - start_pos
 
                 if style != self.black_white:
-                    self.output.SetStyling(len(s), style)
+                    self.output.SetStyling(text_len, style)
             self.stack = []
             self.lock.release()
             self.output.Thaw()