diff options
Diffstat (limited to 'scene/gui/code_edit.h')
-rw-r--r-- | scene/gui/code_edit.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/scene/gui/code_edit.h b/scene/gui/code_edit.h index addbb6e468..53ff65f376 100644 --- a/scene/gui/code_edit.h +++ b/scene/gui/code_edit.h @@ -31,6 +31,7 @@ #ifndef CODE_EDIT_H #define CODE_EDIT_H +#include "core/object/script_language.h" #include "scene/gui/text_edit.h" class CodeEdit : public TextEdit { @@ -124,6 +125,11 @@ private: /* Line Folding */ bool line_folding_enabled = false; + String code_region_start_string; + String code_region_end_string; + String code_region_start_tag = "region"; + String code_region_end_tag = "endregion"; + void _update_code_region_tags(); /* Delimiters */ enum DelimiterType { @@ -231,8 +237,11 @@ private: struct ThemeCache { /* Gutters */ Color code_folding_color = Color(1, 1, 1); + Color folded_code_region_color = Color(1, 1, 1); Ref<Texture2D> can_fold_icon; Ref<Texture2D> folded_icon; + Ref<Texture2D> can_fold_code_region_icon; + Ref<Texture2D> folded_code_region_icon; Ref<Texture2D> folded_eol_icon; Color breakpoint_color = Color(1, 1, 1); @@ -292,8 +301,6 @@ protected: static void _bind_compatibility_methods(); #endif - virtual void _update_theme_item_cache() override; - /* Text manipulation */ // Overridable actions @@ -398,6 +405,14 @@ public: bool is_line_folded(int p_line) const; TypedArray<int> get_folded_lines() const; + /* Code region */ + void create_code_region(); + String get_code_region_start_tag() const; + String get_code_region_end_tag() const; + void set_code_region_tags(const String &p_start = "region", const String &p_end = "endregion"); + bool is_line_code_region_start(int p_line) const; + bool is_line_code_region_end(int p_line) const; + /* Delimiters */ void add_string_delimiter(const String &p_start_key, const String &p_end_key, bool p_line_only = false); void remove_string_delimiter(const String &p_start_key); |