Do you have any examples for HTML syntax with collapsible/expandable DOM, c/JavaScript syntax possibly? Are standard scintilla syntax configurations able to be used?
Thanks for clarifying!
Do you have any examples for HTML syntax with collapsible/expandable DOM, c/JavaScript syntax possibly? Are standard scintilla syntax configurations able to be used?
Thanks for clarifying!
The lexers for HTML and JavaScript are included, so they can be colorized or collapsed.
What configurations do you mean?
You may be able to parse a config file and setup the style with our control.
Thanks for the quick response Christian! I’ll give it a go & great work!
If it’s not urgent, just wait for 12.1pr1 in a week or so.
We’ll include some bug fixes.
I have a couple of questions @Christian_Schmitz as I’m trying to decide between Scintilla or my own custom code editor for a project I’m working on.
Can I write my own lexer so I can add support for a language not listed on your website? Specifically I want to be able to parse ObjoScript (my own scripting language I’ve written).
If you put code in a code fence in a Markdown document, does the editor highlight the code in the fence or not?
Some **Markdown** text.
```some-language
Var a = 10 <-------- Can this be highlighted??
```
The over 100 lexers built-in are written in C.
You can do your own basically using the StyleNeeded event.
The you can do it in Xojo yourself, but that may be some work.
some lexers do embedded code, e.g. html and php together. Or JavaScript in HTML.
So in theory I could parse the entire contents of the code editor periodically and then when the StyleNeeded event fires query my parse tree for the correct colours?
Do you know what triggers the StyleNeeded event to fire?
Whenever it needs style for some piece of text, e.g. when it displays or later when the user changed some text and new style is needed.
Feel free to try it. If you have your own formatting code, you may be able to adapt it to format a section. And remember metadata between calls.