Pārlūkot izejas kodu

Merge pull request #110397 from mooflu/syntaxhi-110390

Don't reset color if the previous token is a number ending with a dot.
Thaddeus Crews 1 mēnesi atpakaļ
vecāks
revīzija
d51c13fdd4
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      modules/gdscript/editor/gdscript_highlighter.cpp

+ 3 - 1
modules/gdscript/editor/gdscript_highlighter.cpp

@@ -437,7 +437,9 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting_impl(int p_l
 			if (col != Color()) {
 				for (int k = j - 1; k >= 0; k--) {
 					if (str[k] == '.') {
-						col = Color(); // Keyword, member & global func indexing not allowed.
+						// Keyword, member, & global func indexing not allowed,
+						// but don't reset color if prev was a number like "5."
+						col = (prev_type == NUMBER) ? col : Color();
 						break;
 					} else if (str[k] > 32) {
 						break;