diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index f79435260ba..c6aae9c4cba 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -5488,7 +5488,7 @@ int TextEdit::_is_line_in_region(int p_line) { // If not find the closest line we have. int previous_line = p_line - 1; for (; previous_line > -1; previous_line--) { - if (color_region_cache.has(p_line)) { + if (color_region_cache.has(previous_line)) { break; } }