From 6ea9b581d7d9a95232e18793cd7c0c550163f442 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 21 Feb 2023 12:53:41 +0100 Subject: [PATCH] Ported: Fix colour region continuation over blank lines, issue 41120 - Paulb23 https://github.com/godotengine/godot/commit/5cf2cf864636d515cd9c2a9ba5f946662fd8f8e2 --- modules/gdscript/editor/gdscript_highlighter.cpp | 5 +++++ scene/resources/syntax_highlighter.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp index 4f4137171..df6d472c1 100644 --- a/modules/gdscript/editor/gdscript_highlighter.cpp +++ b/modules/gdscript/editor/gdscript_highlighter.cpp @@ -83,6 +83,11 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting(int p_line) const String &str = text_edit->get_line(p_line); const int line_length = str.length(); Color prev_color; + + if (in_region != -1 && str.length() == 0) { + color_region_cache[p_line] = in_region; + } + for (int j = 0; j < str.length(); j++) { Dictionary highlighter_info; diff --git a/scene/resources/syntax_highlighter.cpp b/scene/resources/syntax_highlighter.cpp index a31c8070b..a2effe534 100644 --- a/scene/resources/syntax_highlighter.cpp +++ b/scene/resources/syntax_highlighter.cpp @@ -169,6 +169,11 @@ Dictionary CodeHighlighter::_get_line_syntax_highlighting(int p_line) { const String &str = text_edit->get_line(p_line); const int line_length = str.length(); Color prev_color; + + if (in_region != -1 && str.length() == 0) { + color_region_cache[p_line] = in_region; + } + for (int j = 0; j < line_length; j++) { Dictionary highlighter_info;