editors/CodeFileEditor.py
changeset 2518 c48470e2b383
parent 2437 105c20fdeb19
child 2525 9812b332f350
equal deleted inserted replaced
2517:cbfcae21c698 2518:c48470e2b383
   278         self.ShowHighlights()
   278         self.ShowHighlights()
   279 
   279 
   280     def RefreshSectionStyling(self):
   280     def RefreshSectionStyling(self):
   281         self.Colourise(0, -1)
   281         self.Colourise(0, -1)
   282 
   282 
   283         text = self.GetText()
       
   284         for line in xrange(self.GetLineCount()):
   283         for line in xrange(self.GetLineCount()):
   285             self.SetLineState(line, 0)
   284             self.SetLineState(line, 0)
   286 
   285 
       
   286         doc_end_pos = self.GetLength()
   287         for section in self.Controler.SECTIONS_NAMES:
   287         for section in self.Controler.SECTIONS_NAMES:
   288             section_comments = self.SectionsComments[section]
   288             section_comments = self.SectionsComments[section]
   289             start_pos = text.find(section_comments["comment"])
   289             start_pos = self.FindText(0, doc_end_pos, section_comments["comment"])
   290             end_pos = start_pos + len(section_comments["comment"])
   290             end_pos = start_pos + len(section_comments["comment"])
   291             self.StartStyling(start_pos, 0xff)
   291             self.StartStyling(start_pos, 0xff)
   292             self.SetStyling(end_pos - start_pos, STC_CODE_SECTION)
   292             self.SetStyling(end_pos - start_pos, STC_CODE_SECTION)
   293             self.SetLineState(self.LineFromPosition(start_pos), 1)
   293             self.SetLineState(self.LineFromPosition(start_pos), 1)
   294 
   294 
   295         self.StartStyling(end_pos, 0x00)
   295         self.StartStyling(end_pos, 0x00)
   296         self.SetStyling(len(self.GetText()) - end_pos, stc.STC_STYLE_DEFAULT)
   296         self.SetStyling(doc_end_pos - end_pos, stc.STC_STYLE_DEFAULT)
   297 
   297 
   298     def DoGetBestSize(self):
   298     def DoGetBestSize(self):
   299         return self.ParentWindow.GetPanelBestSize()
   299         return self.ParentWindow.GetPanelBestSize()
   300 
   300 
   301     def RefreshModel(self):
   301     def RefreshModel(self):