From c538b3002100a89af7858bd7d1eee9dd36ad96a3 Mon Sep 17 00:00:00 2001 From: Magian Date: Fri, 3 May 2024 12:49:39 +0800 Subject: [PATCH] Fix shader highlighting the interruption in color_region caused by disabled_branch_regions. --- editor/plugins/text_shader_editor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp index 98d83b6e955a..e3d1056824b3 100644 --- a/editor/plugins/text_shader_editor.cpp +++ b/editor/plugins/text_shader_editor.cpp @@ -48,6 +48,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;