Skip to content

Commit d51c13f

Browse files
committed
Merge pull request #110397 from mooflu/syntaxhi-110390
Don't reset color if the previous token is a number ending with a dot.
2 parents 153bd70 + aa8acd1 commit d51c13f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/gdscript/editor/gdscript_highlighter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,9 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting_impl(int p_l
437437
if (col != Color()) {
438438
for (int k = j - 1; k >= 0; k--) {
439439
if (str[k] == '.') {
440-
col = Color(); // Keyword, member & global func indexing not allowed.
440+
// Keyword, member, & global func indexing not allowed,
441+
// but don't reset color if prev was a number like "5."
442+
col = (prev_type == NUMBER) ? col : Color();
441443
break;
442444
} else if (str[k] > 32) {
443445
break;

0 commit comments

Comments
 (0)