Fix updating delimiter cache of CodeEdit when typing on the first line

This commit is contained in:
HolonProduction
2023-11-21 22:39:45 +01:00
parent 2d0ee20ff3
commit d5847fa54e
2 changed files with 27 additions and 1 deletions

View File

@ -2904,7 +2904,7 @@ void CodeEdit::_update_delimiter_cache(int p_from_line, int p_to_line) {
int in_region = -1;
for (int i = start_line; i < MIN(end_line + 1, line_count); i++) {
int current_end_region = (i <= 0 || delimiter_cache[i].size() < 1) ? -1 : delimiter_cache[i].back()->value();
int current_end_region = (i < 0 || delimiter_cache[i].size() < 1) ? -1 : delimiter_cache[i].back()->value();
in_region = (i <= 0 || delimiter_cache[i - 1].size() < 1) ? -1 : delimiter_cache[i - 1].back()->value();
const String &str = get_line(i);