From e905e8f145ef5d91aa6f8200bf415569e28d5967 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 8 Apr 2021 16:12:22 +0200 Subject: [PATCH] Highlight control flow keywords with a different color This makes them easier to distinguish from other keywords. --- core/object/script_language.h | 1 + editor/editor_settings.cpp | 1 + editor/editor_themes.cpp | 2 ++ editor/plugins/editor_preview_plugins.cpp | 20 +++++++++++++++---- editor/plugins/script_editor_plugin.cpp | 7 ++++++- editor/plugins/shader_editor_plugin.cpp | 7 ++++++- .../plugins/visual_shader_editor_plugin.cpp | 14 +++++++++++-- .../gdnative/nativescript/nativescript.cpp | 4 ++++ modules/gdnative/nativescript/nativescript.h | 1 + .../pluginscript/pluginscript_language.cpp | 4 ++++ .../pluginscript/pluginscript_language.h | 1 + .../gdscript/editor/gdscript_highlighter.cpp | 7 ++++++- 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 | 4 ++++ modules/visual_script/visual_script.h | 1 + servers/rendering/shader_language.cpp | 14 +++++++++++++ servers/rendering/shader_language.h | 1 + 20 files changed, 115 insertions(+), 9 deletions(-) diff --git a/core/object/script_language.h b/core/object/script_language.h index f9898ccd0c2..bb46c718b2b 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -303,6 +303,7 @@ public: void get_core_type_words(List *p_core_type_words) const; 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