diff options
Diffstat (limited to 'editor/plugins/text_shader_editor.cpp')
-rw-r--r-- | editor/plugins/text_shader_editor.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp index a1d1df0f83..f52c89e736 100644 --- a/editor/plugins/text_shader_editor.cpp +++ b/editor/plugins/text_shader_editor.cpp @@ -49,6 +49,11 @@ Dictionary GDShaderSyntaxHighlighter::_get_line_syntax_highlighting_impl(int p_l for (const Point2i ®ion : disabled_branch_regions) { if (p_line >= region.x && p_line <= region.y) { + // When "color_regions[0].p_start_key.length() > 2", + // disabled_branch_region causes color_region to break. + // This should be seen as a temporary solution. + CodeHighlighter::_get_line_syntax_highlighting_impl(p_line); + Dictionary highlighter_info; highlighter_info["color"] = disabled_branch_color; @@ -335,7 +340,7 @@ void ShaderTextEditor::_load_theme_settings() { warnings_panel->add_theme_font_size_override("normal_font_size", EditorNode::get_singleton()->get_editor_theme()->get_font_size(SNAME("main_size"), EditorStringName(EditorFonts))); } - syntax_highlighter->set_uint_suffix_enabled(); + syntax_highlighter->set_uint_suffix_enabled(true); } void ShaderTextEditor::_check_shader_mode() { @@ -583,9 +588,7 @@ void ShaderTextEditor::_update_warning_panel() { int warning_count = 0; warnings_panel->push_table(2); - for (int i = 0; i < warnings.size(); i++) { - ShaderWarning &w = warnings[i]; - + for (const ShaderWarning &w : warnings) { if (warning_count == 0) { if (saved_treat_warning_as_errors) { String error_text = "error(" + itos(w.get_line()) + "): " + w.get_message() + " " + TTR("Warnings should be fixed to prevent errors."); |