mirror of
https://github.com/godotengine/godot.git
synced 2025-10-24 02:13:36 +00:00
Highlight control flow keywords with a different color
This makes them easier to distinguish from other keywords.
This commit is contained in:
parent
758bccf364
commit
e905e8f145
20 changed files with 115 additions and 9 deletions
|
|
@ -140,10 +140,15 @@ void EditorStandardSyntaxHighlighter::_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> keywords;
|
||||
script->get_language()->get_reserved_words(&keywords);
|
||||
for (List<String>::Element *E = keywords.front(); E; E = E->next()) {
|
||||
highlighter->add_keyword_color(E->get(), keyword_color);
|
||||
if (script->get_language()->is_control_flow_keyword(E->get())) {
|
||||
highlighter->add_keyword_color(E->get(), control_flow_keyword_color);
|
||||
} else {
|
||||
highlighter->add_keyword_color(E->get(), keyword_color);
|
||||
}
|
||||
}
|
||||
|
||||
/* Member types. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue