1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Fix TextEdit color_region_cache bug

Due to a single error, _is_line_in_region was previously iterating over the color highlighting for the entire document repeatedly for each line in the script.

This is now fixed, which should make the editor much faster with large scripts.

(cherry picked from commit 57306bf0e3)
This commit is contained in:
lawnjelly
2023-03-11 16:18:29 +00:00
committed by Rémi Verschelde
parent acb8899821
commit 891b17d5db

View File

@@ -5475,7 +5475,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;
}
}