1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Code region keywords must be followed by whitespace

This commit is contained in:
Julian
2025-01-08 17:05:10 -05:00
parent 76c8e76560
commit ba3f4a4b24
2 changed files with 10 additions and 2 deletions

View File

@@ -150,6 +150,12 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting_impl(int p_l
break;
}
}
// "#region" and "#endregion" only highlighted if they're the first region on the line.
if (color_regions[c].type == ColorRegion::TYPE_CODE_REGION &&
str.strip_edges().split_spaces()[0] != "#region" &&
str.strip_edges().split_spaces()[0] != "#endregion") {
match = false;
}
if (!match) {
continue;
}