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

Re: Highlight.Analize and other things


On Sat, 14 Nov 2026 at 18:23, Benoît Minisini <
benoit.minisini@xxxxxxxxxxxxxxxx> wrote:

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


Thanks Benoit.
I'm not sure i understood that fully. sounded like using (and having) the
Static list is no good then, or unreliable?

I'm guessing if i check the values from an editors currently loaded
highlighter it will guarantee valid values?
    TextEditor1.Theme.GetStateIndex("Shebang")

Or were you saying there is an internal JIT issue that needs addressing
that might cause conflicts?

Personally I have set a global system env GB_NO_JIT=1 and am setting the
Env[] in my application startups.
I tested my editor to see the balance of the delay on a programs first load
compared to it's future load speed with and without JIT.
Seems the only "real noticeable" difference is when I use JIT is the
program takes longer to start on first load.
It is a more noticeable delay than any delay in having JIT disabled when my
programs run.

Respects
BruceS

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>
Re: Highlight.Analize and other thingsBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>