[Gambas-user] New experimental highlighting component

Benoît Minisini benoit.minisini at gambas-basic.org
Fri Oct 20 02:48:05 CEST 2023


Le 20/10/2023 à 02:42, Benoît Minisini a écrit :
> Hi,
> 
> I recently committed a new component named 'gb.highlight' that aims at 
> replacing the current 'gb.eval.highlight' component.
> 
 > ...

I forgot to say a few points:

1) Still to be done is how to imbricate different highlightings. For 
example, I'd like that in an HTML file, everything between '<style 
type="text/css">' and '</style>' is highlighted with the CSS syntax.

This is planned, up to four possible imbrication. Because the 
highlighter state is defined by four bytes, one byte by state number. 
Which means that you cannot have more then 255 states in a definition file.

This limit comes from the fact that the Gambas text editor must store 
the highlighting state of each line, as highlighting is done 
incrementally, line by line. A bigger state means a lot of memory used, 
and I don't like that.

2) Gambas highlighting will still be done with the old method, because 
it is complex, it needs speed, and spaces inside code are rewritten.

Regards,

-- 
Benoît Minisini.



More information about the User mailing list