1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Highlight control flow keywords with a different color

This makes them easier to distinguish from other keywords.
This commit is contained in:
Hugo Locurcio
2021-04-08 16:12:22 +02:00
parent 758bccf364
commit e905e8f145
20 changed files with 115 additions and 9 deletions

View File

@@ -141,9 +141,14 @@ void ShaderTextEditor::_load_theme_settings() {
List<String> keywords;
ShaderLanguage::get_keyword_list(&keywords);
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");
for (List<String>::Element *E = keywords.front(); E; E = E->next()) {
syntax_highlighter->add_keyword_color(E->get(), keyword_color);
if (ShaderLanguage::is_control_flow_keyword(E->get())) {
syntax_highlighter->add_keyword_color(E->get(), control_flow_keyword_color);
} else {
syntax_highlighter->add_keyword_color(E->get(), keyword_color);
}
}
// Colorize built-ins like `COLOR` differently to make them easier