TextViewer.py
changeset 589 e3a1d9a59c97
parent 586 9aa96a36cf33
child 600 7db729686416
equal deleted inserted replaced
588:4876fedbe9df 589:e3a1d9a59c97
   804     def ShowHighlights(self, start_pos, end_pos):
   804     def ShowHighlights(self, start_pos, end_pos):
   805         for indent, start, end, highlight_type in self.Highlights:
   805         for indent, start, end, highlight_type in self.Highlights:
   806             if start[0] == 0:
   806             if start[0] == 0:
   807                 highlight_start_pos = start[1] - indent
   807                 highlight_start_pos = start[1] - indent
   808             else:
   808             else:
   809                 highlight_start_pos = self.GetLineEndPosition(start[0] - 1) + start[1] - indent + 1
   809                 highlight_start_pos = self.Editor.GetLineEndPosition(start[0] - 1) + start[1] - indent + 1
   810             if end[0] == 0:
   810             if end[0] == 0:
   811                 highlight_end_pos = end[1] - indent + 1
   811                 highlight_end_pos = end[1] - indent + 1
   812             else:
   812             else:
   813                 highlight_end_pos = self.GetLineEndPosition(end[0] - 1) + end[1] - indent + 2
   813                 highlight_end_pos = self.Editor.GetLineEndPosition(end[0] - 1) + end[1] - indent + 2
   814             if highlight_start_pos < end_pos and highlight_end_pos > start_pos:
   814             if highlight_start_pos < end_pos and highlight_end_pos > start_pos:
   815                 self.StartStyling(highlight_start_pos, 0xff)
   815                 self.StartStyling(highlight_start_pos, 0xff)
   816                 self.SetStyling(highlight_end_pos - highlight_start_pos, highlight_type)
   816                 self.SetStyling(highlight_end_pos - highlight_start_pos, highlight_type)
   817 
   817                 self.StartStyling(highlight_start_pos, 0x00)
       
   818                 self.SetStyling(len(self.Editor.GetText()) - highlight_end_pos, wx.stc.STC_STYLE_DEFAULT)
       
   819