[QScintilla] QScintilla 2.8.4: custom lexer and QsciLexerCustom::styleText() in particular

Alan Garny agarny at hellix.com
Mon Jan 19 10:39:23 GMT 2015


Hi,

 

FWIW, I thought I would check what QScintilla does prior to calling
styleText(), and we can see that it uses the end styled value to determine
the 'start' value that is passed to styleText()(see
QsciLexerCustom::handleStyleNeeded()). Now, depending on how you style the
text, that end styled value may not be optimal at all and it clearly wasn't
in my case. I would have expected QsciLexerCustom::handleStyleNeeded() to
set the end styled value to the 'end' value that is passed to styleText(),
but it doesn't. So, in the end, I now do it in my implementation of
styleText() by simply calling startStyling(end) at the end of my
implementation. To do so makes the styling as fast as possible. Also, as a
result, I am not getting unnecessary calls to styleText(). So, as far as I
can tell, everything works fine and until
QsciLexerCustom::handleStyleNeeded() gets fixed (so that it updates the end
styled value, as I think it should), people should indirectly update that
end styled value themselves in their implementation of styleText().

 

Alan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20150119/e97012e1/attachment.html>


More information about the QScintilla mailing list