QScintilla/Lexers/LexerPygments.py

changeset 45
9a18f4dbb493
parent 13
1af94a91f439
child 97
c4086afea02b
equal deleted inserted replaced
44:fe5cd20cb0eb 45:9a18f4dbb493
341 @return flag indicating the lexer capability (boolean) 341 @return flag indicating the lexer capability (boolean)
342 """ 342 """
343 if self.editor is None: 343 if self.editor is None:
344 return True 344 return True
345 345
346 ## text = self.editor.text().encode('utf-8')
347 text = self.editor.text() 346 text = self.editor.text()
348 self.__lexer = self.__guessLexer(text) 347 self.__lexer = self.__guessLexer(text)
349 348
350 return self.__lexer is not None 349 return self.__lexer is not None
351 350
365 Public method to perform the styling. 364 Public method to perform the styling.
366 365
367 @param start position of first character to be styled (integer) 366 @param start position of first character to be styled (integer)
368 @param end position of last character to be styled (integer) 367 @param end position of last character to be styled (integer)
369 """ 368 """
370 ## text = self.editor.text()[:end + 1].encode('utf-8')
371 text = self.editor.text()[:end + 1] 369 text = self.editor.text()[:end + 1]
372 self.__lexer = self.__guessLexer(text) 370 self.__lexer = self.__guessLexer(text)
373 371
374 cpos = 0 372 cpos = 0
375 self.editor.startStyling(cpos, 0x3f) 373 self.editor.startStyling(cpos, 0x3f)

eric ide

mercurial