Describe the project you are working on:
Something that requires the TextEdit node to highlight symbols
Describe the problem or limitation you are having in your project:
The TextEdit control node doesn't highlight symbols.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
A new function being added called add_symbol_color() or symbols being accepted in add_keyword_color(). This could be used to create text editors that highlight symbols related to the game or for programming languages such as Brainfuck.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
I'm not sure. Currently I just know that in the Godot Engine source code, all keywords are being added to a dictionary with an associated color, then it's the syntax highlighter that checks if the character is a symbol with is_symbol() where currently the only part where the expected return value is true is when highlighting ranges.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Not as far as I know... I'm currently creating one myself with a RichTextLabel and constantly checking what the user input is, to then highlight it with a BBcode.
Is there a reason why this should be core and not an add-on in the asset library?:
The TextEdit node could be used for many many different projects, but it not being able to syntax highlight symbols makes it more limited.
There is a discussion on the main repos issue board somewhere. Specifically talking about making a clearer distinction between the TextEditor and the ScriptEditor, and making the latter a proper node. Can't find it anywhere as it was likely offtopic in another issue.
Right now TextEdit has a bunch of the base components of a ScriptEditor, but the vast majority of them needs re implementation in c++ if you were to use it.
i have a suggestion
Add the ScriptEditor as a node in so we can use it for our projects
@Airbus5717 Doing so would increase the binary size noticeably even though very few people would make use of it.
hmm godot size is fine
obv more features bigger size
i like godot
or if its possible to make some nodes installed from assets or so
What I don't understand is the difference between the ScriptEditor and TextEditor, I thought the Godot Engine was created with Godot. And all of the features in the TextEditor matches the ones in the ScriptEditor no?
Any way, it wouldn't make sense to create an entirely new node when (at least from this issue) the only problem is highlighting symbols.
No there is alot of features in script editor not available in Texteditor node
I thought the Godot Engine was created with Godot.
Indeed, the editor is made with Godot :slightly_smiling_face: Not all nodes are exposed to projects though. Some nodes are editor-only to keep export template binary sizes smaller.
What's the difference between the script editor and TextEdit node?
Hmm the TextEdit is in godot for projects use as a node
ScriptEditor is the editor u use for coding godot projects in godot engine
i am making a general purpose text editor you can look at the code
https://github.com/Airbus5717/TextEditor
hmm i think i got it working in GDscript now
Check here
https://github.com/Airbus5717/TextEditor
I have a feeling that adding this would be relatively simple when looking at the C++ code. But I'm not comfortable doing this as I'm not too experienced with C++, and I'm even less experienced when it comes to using SCons and compilers.
The main discussion with this though, should be figuring out _how_ it should be added.
Should it be a function attached to the TextEdit node called something like add_symbol_color() to separate keywords and symbols, or should a symbol be an allowed keyword so that it works with add_keyword_color()?
Most helpful comment
There is a discussion on the main repos issue board somewhere. Specifically talking about making a clearer distinction between the TextEditor and the ScriptEditor, and making the latter a proper node. Can't find it anywhere as it was likely offtopic in another issue.
Right now TextEdit has a bunch of the base components of a ScriptEditor, but the vast majority of them needs re implementation in c++ if you were to use it.