[Gambas-user] How does gb.highlight affect older projects with editor

Rolf-Werner Eilert rwe-sse at osnanet.de
Wed Nov 22 09:10:25 CET 2023


Thank you Bruce!

Just to give you an impression, in the bigger project I have a Sub which 
is jumped into by some event:

Public Sub SourceText_Highlight(Text As String)

Within this Sub there is a for...next loop jumping through the whole 
text and switching on or off the status for each character, such as 
normal text, comment, command etc. At the end of the for...next loop, 
there is

TextHighlighter.Add(status)
status = nextStatus

and it goes on the the next character. That's all.

I guess I simply have to try what the actual impact is on my projects 
after having updated to the newer Gambas version. As we will close our 
company in July next year, I planned not to update to any newer software 
versions of server and clients until then. So the whole bunch of 
programs running here simply keeps running until day X. I just don't 
feel like recoding a major part of the software for just a few months.

At home, I kept my Gambas more frequently updated, but then it will be 
not so critical.

No, I do recognize the advantages of the new highlighter, it's just 
"where does it make sense to switch to the new version".

By the way, is there a way to see in the IDE where a component is used 
in the project? Maybe browsing that would give me an impression of the 
amount of effort to invest.

Regards
Rolf



Am 21.11.23 um 13:57 schrieb Bruce Steers:
> you can no longer use gb.eval.highlight with TextEditor as Texteditor 
> now uses gb.highlight and it conflicts with gb.eval.highlight.
> 
> .I have a number of programs using textedidor and have not had much 
> problem. just a little tweak here and there.
> 
> Mostly i have found the following...
> 
> gb.highlight is "mostly" compatible compatible with gb.eval.highlight code.
> 
> The TextEditor.Styles property has gone but you can either change it to 
> TexEditor.Theme or use a hidden method TexEditor1/_GetStyles()
> 
> A project using text editor will not function until you remove 
> gb.eval.highlight component due to TextHighlighter.CanRewrite property 
> changing from static.
> You have to load the project and remove gb.eval.highlight manually as 
> TextEditor "Requires" gb.highlight so it adds it automatically causing a 
> conflict.
> 
> For the most part there is not much of a change but bare in mind i have 
> not used gb.eval.highlight component much myself i have just used 
> texteditor that uses it and the change inside there is barely noticable.
> 
> On the plus side now many custom highlight files can be created and 
> loaded from file by your programs :)
> 
> 
> BruceS
> 
> 
> On Tue, 21 Nov 2023 at 10:57, Rolf-Werner Eilert <rwe-sse at osnanet.de 
> <mailto:rwe-sse at osnanet.de>> wrote:
> 
>     The new gb.highlight surely reads like a nifty peace of software, it
>     remembers me of the Python Lexer which is controlled via a css file.
> 
>     But what about my older software projects which still use the
>     gb.eval.highlight component? There are a few where I use the editor to
>     enable the user to edit my own config or macro files with their own
>     highlighting. And in these projects, the editor appears at different
>     places/dialogs with different highlightings for different kinds of
>     files.
> 
>     Will I have to rewrite them? Or will you leave the gb.eval.highlight
>     component in the list? Or will there be a compatibility level for the
>     editor?
> 
>     I remember that some time ago there has been a change to this
>     highlighting thing. It was said, you have to recode everything, but it
>     turned out relatively easy as I merely had to change some keywords. The
>     rest of it had remained the same. Here the effort will be much
>     greater I
>     guess.
> 
>     Regards
>     Rolf
> 
>     ----[ http://gambaswiki.org/wiki/doc/netiquette
>     <http://gambaswiki.org/wiki/doc/netiquette> ]----
> 
> 
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----



More information about the User mailing list