editors/CodeFileEditor.py
branchpython3
changeset 3795 223a91584172
parent 3752 9f6f46dbe3ae
child 3932 62d04933d569
equal deleted inserted replaced
3794:36934591f6eb 3795:223a91584172
   285             self.SetLineState(line, 0)
   285             self.SetLineState(line, 0)
   286 
   286 
   287         doc_end_pos = self.GetLength()
   287         doc_end_pos = self.GetLength()
   288         for section in self.Controler.SECTIONS_NAMES:
   288         for section in self.Controler.SECTIONS_NAMES:
   289             section_comments = self.SectionsComments[section]
   289             section_comments = self.SectionsComments[section]
   290             start_pos, end_pos = self.FindText(0, doc_end_pos, section_comments["comment"])
   290             txttofind = section_comments["comment"]
       
   291             results = self.FindText(0, doc_end_pos, txttofind)
       
   292             if wx.VERSION < (4, 1, 0):
       
   293                 start_pos = results
       
   294                 end_pos = start_pos+len(txttofind)
       
   295             else:
       
   296                 start_pos, end_pos = results
   291             self.StartStyling(start_pos)
   297             self.StartStyling(start_pos)
   292             self.SetStyling(end_pos - start_pos, STC_CODE_SECTION)
   298             self.SetStyling(end_pos - start_pos, STC_CODE_SECTION)
   293             self.SetLineState(self.LineFromPosition(start_pos), 1)
   299             self.SetLineState(self.LineFromPosition(start_pos), 1)
   294 
   300 
   295         self.StartStyling(end_pos)
   301         self.StartStyling(end_pos)
   592                 highlight_end_pos = end[1] + 1
   598                 highlight_end_pos = end[1] + 1
   593             else:
   599             else:
   594                 highlight_end_pos = self.GetLineEndPosition(end[0] - 1) + end[1] + 2
   600                 highlight_end_pos = self.GetLineEndPosition(end[0] - 1) + end[1] + 2
   595             self.StartStyling(highlight_start_pos)
   601             self.StartStyling(highlight_start_pos)
   596             self.SetStyling(highlight_end_pos - highlight_start_pos, highlight_type)
   602             self.SetStyling(highlight_end_pos - highlight_start_pos, highlight_type)
   597             self.StartStyling(highlight_end_pos)
   603             self.StartStyling(highlight_end_pos, 0x00)
   598             self.SetStyling(len(self.GetText()) - highlight_end_pos, stc.STC_STYLE_DEFAULT)
   604             self.SetStyling(len(self.GetText()) - highlight_end_pos, stc.STC_STYLE_DEFAULT)
   599 
   605 
   600 
   606 
   601 # -------------------------------------------------------------------------------
   607 # -------------------------------------------------------------------------------
   602 #                         Helper for VariablesGrid values
   608 #                         Helper for VariablesGrid values