[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Highlight.Analize and other things


Le 14/11/2026 à 15:53, Bruce Steers a écrit :

So now i have 2 alternatives after using the TextEditor.GetHighlight() method

If aTypes[0] = Highlight.Comment   ' for gambas code
If aTypes[0] = Highlight["Comment"]  ' for others

If aTypes[0] = Highlight["Shebang"]  ' now both 19 on my shell scripts. (i was confused here as Highlight.Datatype constant is 19 so this was where things were wrong for me)

It seems the _get method getting TextHighlighter constants cannot be used with gambas files, they are incompatible.

As for example Highlight["Comment"] = 6 and Highlight.Comment = 9

I assume being a Static function the TextHighlighterTheme.GetStateIndex(State) results ar generic and the same for all the different highlighters?

Respects
BruceS


State integer values are dynamic. They change according to the order in which each highlighter is compiled.

By the way I think this leads to a problem with highlighter JIT compilation, because then the result of the compilation depends on the order in which the highlighter is loaded in the current process. So the cache is actually used only for the same highlighters loaded in same order. Weird!

I will think about a solution. Or maybe not a solution, but some code reorganization that leads to less JIT compilation time, and better JIT cache use.

Regards,

--
Benoît Minisini.


Follow-Ups:
Re: Highlight.Analize and other thingsBruce Steers <bsteers4@xxxxxxxxx>
References:
Highlight.Analize and other thingsBruce Steers <bsteers4@xxxxxxxxx>
Re: Highlight.Analize and other thingsBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: Highlight.Analize and other thingsBruce Steers <bsteers4@xxxxxxxxx>
Re: Highlight.Analize and other thingsBruce Steers <bsteers4@xxxxxxxxx>