summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-04-10 22:02:24 +0200
committerGitHub <noreply@github.com>2018-04-10 22:02:24 +0200
commit0f6fdb77c58f6f17bcdd85b107ad30b4e04edf3f (patch)
treea6101a81b62dab44db515630809a94e00797138a
parenta522bb110627e2b8324d8e79a2f4ce972e7dba3e (diff)
parentaba4247910282ba5974beea471d86f6a90f4a0f0 (diff)
Merge pull request #18116 from Paulb23/fix_shader_highlighting
Fixed colour region calculation for the first line, issue 18104
-rw-r--r--scene/gui/text_edit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index cc6a677ec8..633ffedd04 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4023,6 +4023,9 @@ int TextEdit::_is_line_in_region(int p_line) {
// calculate up to line we need and update the cache along the way.
int in_region = color_region_cache[previous_line];
+ if (previous_line == -1) {
+ in_region = -1;
+ }
for (int i = previous_line; i < p_line; i++) {
const Map<int, Text::ColorRegionInfo> &cri_map = _get_line_color_region_info(i);
for (const Map<int, Text::ColorRegionInfo>::Element *E = cri_map.front(); E; E = E->next()) {