Fixing bug that calls text styling in a loop while some highlighting is defined
--- a/TextViewer.py Wed Nov 16 23:35:15 2011 +0100
+++ b/TextViewer.py Fri Nov 18 17:37:43 2011 +0100
@@ -806,12 +806,14 @@
if start[0] == 0:
highlight_start_pos = start[1] - indent
else:
- highlight_start_pos = self.GetLineEndPosition(start[0] - 1) + start[1] - indent + 1
+ highlight_start_pos = self.Editor.GetLineEndPosition(start[0] - 1) + start[1] - indent + 1
if end[0] == 0:
highlight_end_pos = end[1] - indent + 1
else:
- highlight_end_pos = self.GetLineEndPosition(end[0] - 1) + end[1] - indent + 2
+ highlight_end_pos = self.Editor.GetLineEndPosition(end[0] - 1) + end[1] - indent + 2
if highlight_start_pos < end_pos and highlight_end_pos > start_pos:
self.StartStyling(highlight_start_pos, 0xff)
self.SetStyling(highlight_end_pos - highlight_start_pos, highlight_type)
-
+ self.StartStyling(highlight_start_pos, 0x00)
+ self.SetStyling(len(self.Editor.GetText()) - highlight_end_pos, wx.stc.STC_STYLE_DEFAULT)
+