# HG changeset patch # User laurent # Date 1321634263 -3600 # Node ID e3a1d9a59c97474a802664fc5c415a021a27fbb0 # Parent 4876fedbe9dfff4ea98b0375ff882b2542bf7dc5 Fixing bug that calls text styling in a loop while some highlighting is defined diff -r 4876fedbe9df -r e3a1d9a59c97 TextViewer.py --- 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) +