DPF-Widgets
DPF-Widgets copied to clipboard
Add setLanguageDefinition to the text editor
trafficstars
This change enables changing the language definition.
Hello, first time contributor to DISTRHO, hope that's ok to make such PR!
Too bad there are only a few languages available: https://github.com/DISTRHO/DPF-Widgets/blob/main/opengl/DearImGuiColorTextEditor/TextEditor.h#L185-L191
But I did a quick test by modifying the test. Might be worth to add:
win.editor.setLanguageDefinition(TextEditor::LanguageDefinition::Lua());
or something, to show how it's used.
I see, thanks! In my project, I used an existing definition and changed its name like that:
auto ldef = TextEditor::LanguageDefinition::HLSL();
ldef.mName = "UZU";
setLanguageDefinition(ldef);