diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp index 69564324d12..9bcb21909f5 100644 --- a/modules/gdscript/editor/gdscript_highlighter.cpp +++ b/modules/gdscript/editor/gdscript_highlighter.cpp @@ -430,6 +430,7 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting_impl(int p_l expect_type = false; } else if (member_keywords.has(word)) { col = member_keywords[word]; + in_member_variable = true; } if (col != Color()) { @@ -442,7 +443,7 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting_impl(int p_l } } - if (col != Color()) { + if (!in_member_variable && col != Color()) { in_keyword = true; keyword_color = col; } @@ -627,7 +628,7 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting_impl(int p_l color = keyword_color; } else if (in_signal_declaration) { next_type = SIGNAL; - color = member_color; + color = member_variable_color; } else if (in_function_name) { next_type = FUNCTION; if (!in_lambda && in_function_declaration) { @@ -646,7 +647,7 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting_impl(int p_l color = type_color; } else if (in_member_variable) { next_type = MEMBER; - color = member_color; + color = member_variable_color; } else { next_type = IDENTIFIER; } @@ -709,7 +710,7 @@ void GDScriptSyntaxHighlighter::_update_cache() { symbol_color = EDITOR_GET("text_editor/theme/highlighting/symbol_color"); function_color = EDITOR_GET("text_editor/theme/highlighting/function_color"); number_color = EDITOR_GET("text_editor/theme/highlighting/number_color"); - member_color = EDITOR_GET("text_editor/theme/highlighting/member_variable_color"); + member_variable_color = EDITOR_GET("text_editor/theme/highlighting/member_variable_color"); /* Engine types. */ const Color types_color = EDITOR_GET("text_editor/theme/highlighting/engine_type_color"); @@ -779,7 +780,7 @@ void GDScriptSyntaxHighlighter::_update_cache() { global_functions.insert(E); } - /* Comments */ + /* Comments. */ const Color comment_color = EDITOR_GET("text_editor/theme/highlighting/comment_color"); for (const String &comment : gdscript->get_comment_delimiters()) { String beg = comment.get_slicec(' ', 0); @@ -811,15 +812,14 @@ void GDScriptSyntaxHighlighter::_update_cache() { add_color_region(ColorRegion::TYPE_MULTILINE_STRING, "\"\"\"", "\"\"\"", string_color, false, true); add_color_region(ColorRegion::TYPE_MULTILINE_STRING, "'''", "'''", string_color, false, true); - const Ref