diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-01-26 15:56:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-26 15:56:13 +0100 |
commit | 0991c63fbaba61d5c40eef25b756eb034fe0f2fa (patch) | |
tree | 46b1e747491a3542990609a2c8382c02106c15e4 /modules/gdscript | |
parent | d6765c8d8b0a2134b051b655d4422b7816731208 (diff) | |
parent | 749d0c708c1c12bdb168fd5ff762c6ff5799fcde (diff) |
Merge pull request #45479 from lucasvanmol/highlight-patch
Fix highlight color for class attributes that are also keywords
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/editor/gdscript_highlighter.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp index b792ff54d6..ccc942d86b 100644 --- a/modules/gdscript/editor/gdscript_highlighter.cpp +++ b/modules/gdscript/editor/gdscript_highlighter.cpp @@ -269,19 +269,21 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting(int p_line) col = keywords[word]; } else if (member_keywords.has(word)) { col = member_keywords[word]; + } + + if (col != Color()) { for (int k = j - 1; k >= 0; k--) { if (str[k] == '.') { - col = Color(); //member indexing not allowed + col = Color(); // keyword & member indexing not allowed break; } else if (str[k] > 32) { break; } } - } - - if (col != Color()) { - in_keyword = true; - keyword_color = col; + if (col != Color()) { + in_keyword = true; + keyword_color = col; + } } } |