I've just got a look to the scintilla code and realized that only a minor part of Scintilla would have to be updated to get dynamic styling capabilities (30 or 40 lines of existing code in fact, plus some new APIs), I mean by 'dynamic' the capability to tell "I require 200 styles and 4 indicator bits". By simply putting in the CellBuffer the number of bytes that we need per char (i.e. 1+styling bytes), we could replace all the *2 multiplications by *bytesPerChar. Maybe a bit of DocumentAccessor would need modifs as well (to cope with dynamic number of style bytes per char). And Scintilla could go toward 2 or 3 bytes of styling for example releaving completely the styling problem (at least if we keep current philosophy). The stuff would remain compatible with current code. We'd need to transform 'char' in styling API to 'long'. As it would be dynamic the overhead would be only for the languages that need it. The API setting the styling requirement could update the document if not empty to keep current ability to change the lexer on the fly.

I realize that it looks like a major change but maybe not as much as it seems. SinkWorld is probably intended to solve this kind of problems as well but I will really need that soon. If it seems of interest I can do it and put it in common base.

Armel

  Lexers may use the indicator bits although it is rare. The Python
lexer uses an indicator bit to show bad indentation. With the included
set of lexers, I think it is safe to use the most significant bit, bit
7 but that is not available for styles as only 128 styles are allowed.
It is not possible to use bit 6 (or 5) with the HTML or XML lexers.

  Neil


_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to