summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2020-08-09 09:27:16 -0300
committerGitHub <noreply@github.com>2020-08-09 09:27:16 -0300
commitf2149fe763a5678237b417fb9fefec5a5c74ae9d (patch)
tree3a0158ef1ed788b93d3607c547a62aefb4255fc8
parent69c81309cc786cc5702fb8d558636fb31f207971 (diff)
parent5cf2cf864636d515cd9c2a9ba5f946662fd8f8e2 (diff)
Merge pull request #41124 from Paulb23/colour_region_blank_lines
Fix colour region continuation over blank lines
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.cpp4
-rw-r--r--scene/resources/syntax_highlighter.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp
index aba3e07134..ae1f2893f1 100644
--- a/modules/gdscript/editor/gdscript_highlighter.cpp
+++ b/modules/gdscript/editor/gdscript_highlighter.cpp
@@ -82,6 +82,10 @@ 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 9c8f9334a9..4479b822c0 100644
--- a/scene/resources/syntax_highlighter.cpp
+++ b/scene/resources/syntax_highlighter.cpp
@@ -158,6 +158,10 @@ 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;