From a38b447413b1b00a01d68afbaebc3cd25760824a Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 12 Nov 2019 17:08:07 +0100 Subject: [PATCH] Highlight control flow keywords with a different color This makes them easier to distinguish from other keywords. --- core/script_language.h | 1 + editor/editor_settings.cpp | 1 + editor/editor_themes.cpp | 2 ++ editor/plugins/editor_preview_plugins.cpp | 24 +++++++++++++++---- editor/plugins/script_text_editor.cpp | 9 ++++++- editor/plugins/script_text_editor.h | 1 + editor/plugins/shader_editor_plugin.cpp | 7 +++++- editor/plugins/text_editor.cpp | 2 ++ editor/plugins/text_editor.h | 1 + .../plugins/visual_shader_editor_plugin.cpp | 14 +++++++++-- .../gdnative/nativescript/nativescript.cpp | 3 +++ modules/gdnative/nativescript/nativescript.h | 1 + .../pluginscript/pluginscript_language.cpp | 4 ++++ .../pluginscript/pluginscript_language.h | 1 + modules/gdscript/gdscript.cpp | 13 ++++++++++ modules/gdscript/gdscript.h | 1 + modules/mono/csharp_script.cpp | 20 ++++++++++++++++ modules/mono/csharp_script.h | 1 + modules/visual_script/visual_script.cpp | 3 +++ modules/visual_script/visual_script.h | 1 + scene/gui/text_edit.cpp | 1 + scene/gui/text_edit.h | 1 + servers/visual/shader_language.cpp | 14 +++++++++++ servers/visual/shader_language.h | 1 + 24 files changed, 119 insertions(+), 8 deletions(-) diff --git a/core/script_language.h b/core/script_language.h index a53991f900..9013dd406a 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -265,6 +265,7 @@ public: }; virtual void get_reserved_words(List *p_words) const = 0; + virtual bool is_control_flow_keyword(String p_string) const = 0; virtual void get_comment_delimiters(List *p_delimiters) const = 0; virtual void get_string_delimiters(List *p_delimiters) const = 0; virtual Ref