[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gb.highlight could do with none.highlight
[Thread Prev] | [Thread Next]
- Subject: Re: gb.highlight could do with none.highlight
- From: Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
- Date: Fri, 20 Nov 2026 09:20:15 +0100
- To: user@xxxxxxxxxxxxxxxxxxxxxx
Le 19/11/2026 à 18:13, Bruce Steers a écrit :
I've been making an editor that uses gb.highlight.I just hit a bug (in my own coding) that before i started changing a lot of code I thought of a simple workaround that worked.The bug was this... I had many lines of code similar to this... If TextHighlightr[MyEditor.Highlight].CanReWrite Then
You shouldn't. You must store a reference on 'TextHighlighter[MyEditor.Highlight]' somewhere and use it directly instead of recomputing it repeatedly.
All was good untill i laded a document that did not use highlighting so the editors Highlight property was either blank or "none"So then i looked at the code and all the places i'd have to change to work differently if there was no highlighter. there were many places :(But then i had an epiphany.. I added the following as TextHighlighter.class in my project....
> ...I will add a "None" highlighter that does nothing. But it should not be a huge problem in your code to handle the non-highlight case without it!
Regards, -- Benoît Minisini.
| gb.highlight could do with none.highlight | Bruce Steers <bsteers4@xxxxxxxxx> |