17
Is there a text editor that would allow me to create syntax highlighting easily?
(self.text_editors)
Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient
I actually did that, but it was not satisfactory. And I had hard time making it work like how I want to.
Maybe I should use a XML editor or something to make it easier. I'll give it another try (I just found the file again). Maybe from scratch even.
EDIT: To make it clear, I have hard time getting "contexts" working.
Getting highlighting for regex-based selection to work. That seems confusing. I have 7 criterias which is recommended for the G'MIC language.
Note:
#( |$|(#)+).*
gets treated as if it was a comment.#@cli.*
are treated as if they’re a header for CLI codes.\$(-\d+|\w+|\d+)
gets treated as if they’re accessed variables.\w+:
are treated as if they’re commands names.#@gui
gets bolded.There's no standard regarding G'MIC scripting. That being said, here's a representative G'MIC script - https://pastebin.com/cEPW31HJ .
The first one is basically a example script for testing syntax highlighting. The second one is a real world case study. The second one can be found in https://github.com/GreycLab/gmic-community/blob/master/include/reptorian.gmic .
I haven't included some concepts in the example_cli as you can see that reptorian.gmic introduces some concepts not seen in both. Basically, writing a syntax highlighter for G'MIC would be a nightmare. But doable if I can figure things out.
I have a update for you, I am finally pulling it off!
https://media.discordapp.net/attachments/880256029705773099/1138887510710308904/image.png
There will be problems down the road, but I will worry about that later.
So far, the most challenging part was highlighting things that counts as comment rather than pointers to image pixels or accessible variables. That's not the end of my trouble though.
I do want to figure out how to highlight "expr" including newlines inside expr. expr is basically any mathematical expression that is utilized on JIT compilation.
Along with that to set up regex inside it to highlight section of expr.
While still maintaining priority of regex. So, if one regex is more important, it'll overwrite whatever highlighted.
What do you mean? I'm pretty new to making syntax highlighting for KDE Kate, so I'm just now fixing my other thing before I get into much more advanced concept of it.