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) |