From aba4247910282ba5974beea471d86f6a90f4a0f0 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Tue, 10 Apr 2018 20:42:28 +0100 Subject: [PATCH] Fixed color region calculation for the first line --- scene/gui/text_edit.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index cc6a677ec8f..633ffedd04c 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 &cri_map = _get_line_color_region_info(i); for (const Map::Element *E = cri_map.front(); E; E = E->next()) {