summaryrefslogtreecommitdiffstats
path: root/editor/plugins/visual_shader_editor_plugin.cpp
diff options
context:
space:
mode:
authorPaulb23 <p_batty@hotmail.co.uk>2020-09-10 21:25:40 +0100
committerPaulb23 <p_batty@hotmail.co.uk>2021-06-01 15:38:45 +0100
commit680dc9e81a79761f733db5ce7f3fa0c05b8e1ff6 (patch)
tree7a588e2744f4ce5cf7e821742714779102e7bfca /editor/plugins/visual_shader_editor_plugin.cpp
parentc9ce5367e3d35074193eb3999d9e2f9cbb8576c6 (diff)
downloadredot-engine-680dc9e81a79761f733db5ce7f3fa0c05b8e1ff6.tar.gz
Add comment and string tracking to CodeEdit
Diffstat (limited to 'editor/plugins/visual_shader_editor_plugin.cpp')
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index a0757439c3..98e1a1489e 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -848,6 +848,10 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) {
expression_syntax_highlighter->add_color_region("/*", "*/", comment_color, false);
expression_syntax_highlighter->add_color_region("//", "", comment_color, true);
+ expression_box->clear_comment_delimiters();
+ expression_box->add_comment_delimiter("/*", "*/", false);
+ expression_box->add_comment_delimiter("//", "", true);
+
expression_box->set_text(expression);
expression_box->set_context_menu_enabled(false);
expression_box->set_draw_line_numbers(true);
@@ -2984,6 +2988,10 @@ void VisualShaderEditor::_notification(int p_what) {
syntax_highlighter->add_color_region("/*", "*/", comment_color, false);
syntax_highlighter->add_color_region("//", "", comment_color, true);
+ preview_text->clear_comment_delimiters();
+ preview_text->add_comment_delimiter("/*", "*/", false);
+ preview_text->add_comment_delimiter("//", "", true);
+
error_text->add_theme_font_override("font", get_theme_font("status_source", "EditorFonts"));
error_text->add_theme_font_size_override("font_size", get_theme_font_size("status_source_size", "EditorFonts"));
error_text->add_theme_color_override("font_color", get_theme_color("error_color", "Editor"));