[Gambas-user] Need help with TextEditor
Bruce Steers
bsteers4 at gmail.com
Sat Sep 18 17:08:05 CEST 2021
On Fri, 17 Sept 2021 at 15:29, Rolf-Werner Eilert <rwe-sse at osnanet.de>
wrote:
> Am 16.09.21 um 19:09 schrieb Bruce Steers:
> >
> >
> > On Thu, 16 Sept 2021 at 16:40, Rolf-Werner Eilert <rwe-sse at osnanet.de
> > <mailto:rwe-sse at osnanet.de>> wrote:
> >
> > Thank you for the links, Bruce. I browsed through several source
> files,
> > and think I understood the principle.
> >
> > What I miss is, how do I tell the highlighter which style is which
> > color?
> >
> > In the HTML code for instance there is
> >
> > Add(sQuote, Highlight.String)
> >
> > But where is a definition for the color for Highlight.String? I
> > remember
> > in the old editor, I had to define colors for these.
> >
> > If I get that to run, I guess I could do the rest by code. In my case
> > it's only two colors other than "Normal", one for "command" and one
> for
> > "string".
> >
> > Regards
> > Rolf
>
No i'm afraid not.
it's worse than that I think.
You cannot currently create your own TextEditor highlighting routines
without importing gb.form.editor and gb.eval.highlight into your project.
(as far as i know, i think this is what Ben meant by a parser generator)
If you look at my ScriptEd project source here..
https://gitlab.com/bsteers4/scripted/-/tree/old-gambas/.src
you can see 2 folders , TextEditor and gb.eval.highlight , they are just
copies of gb.form.editor and gb.eval.highlight.
I imported the folders from gambas source then de-selected the components
from my project properties as they were now built in.
I added the TextHighlighter_Sh.class to gb.eval.highlight/ and the
TextEditorMode_Sh.class to TextEditor/ (they started as copies of the C
highligher) to that application before Sh highlighting was added to gambas.
So i think currently this will be the only way t create your own
independent highlighter/mode
Though i could be mistaken and need correcting on this.
Could someone (Ben) please confirm/deny if add-on highlighting can be done
or is it the internal classes only that will highlight?
All the best
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210918/2f05a13f/attachment.htm>
More information about the User
mailing list