diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-04-08 16:12:22 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-05-05 22:38:12 +0200 |
commit | e905e8f145ef5d91aa6f8200bf415569e28d5967 (patch) | |
tree | 8cc9416776879b9f719b2efdb402248ea5bb278d /modules/gdscript/editor | |
parent | 758bccf364729474f8ffbcf15a0bb6e9bad02d9c (diff) |
Highlight control flow keywords with a different color
This makes them easier to distinguish from other keywords.
Diffstat (limited to 'modules/gdscript/editor')
-rw-r--r-- | modules/gdscript/editor/gdscript_highlighter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp index ccc942d86b..ca646dff15 100644 --- a/modules/gdscript/editor/gdscript_highlighter.cpp +++ b/modules/gdscript/editor/gdscript_highlighter.cpp @@ -485,10 +485,15 @@ void GDScriptSyntaxHighlighter::_update_cache() { /* Reserved words. */ const Color keyword_color = EDITOR_GET("text_editor/highlighting/keyword_color"); + const Color control_flow_keyword_color = EDITOR_GET("text_editor/highlighting/control_flow_keyword_color"); List<String> keyword_list; gdscript->get_reserved_words(&keyword_list); for (List<String>::Element *E = keyword_list.front(); E; E = E->next()) { - keywords[E->get()] = keyword_color; + if (gdscript->is_control_flow_keyword(E->get())) { + keywords[E->get()] = control_flow_keyword_color; + } else { + keywords[E->get()] = keyword_color; + } } /* Comments */ |