Code Editor: Fix regression with using doc comments for code regions

This commit is contained in:
Danil Alexeev 2023-10-12 23:20:40 +03:00
parent b1371806ad
commit 881fe67d94
No known key found for this signature in database
GPG key ID: 124453E157DA8DC7
3 changed files with 9 additions and 4 deletions

View file

@ -2862,7 +2862,8 @@ void CodeEdit::_update_code_region_tags() {
return;
}
for (int i = 0; i < delimiters.size(); i++) {
// A shorter delimiter has higher priority.
for (int i = delimiters.size() - 1; i >= 0; i--) {
if (delimiters[i].type != DelimiterType::TYPE_COMMENT) {
continue;
}
@ -3104,6 +3105,8 @@ void CodeEdit::_add_delimiter(const String &p_start_key, const String &p_end_key
ERR_FAIL_COND_MSG(delimiters[i].start_key == p_start_key, "delimiter with start key '" + p_start_key + "' already exists.");
if (p_start_key.length() < delimiters[i].start_key.length()) {
at++;
} else {
break;
}
}