diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2018-04-09 16:05:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-09 16:05:26 +0200 |
| commit | 36552c2c90a8fb714d2fd8aec37e4bd2f876b090 (patch) | |
| tree | bbcbc37256973c5ea89984374d7e0663ef7e28cc /scene/gui/text_edit.h | |
| parent | ea0e73f3c8be433dba3b98808b57dd1e2ca4d934 (diff) | |
| parent | b571a29df563133e9dfde738c6020c9111729ef6 (diff) | |
| download | redot-engine-36552c2c90a8fb714d2fd8aec37e4bd2f876b090.tar.gz | |
Merge pull request #18040 from Paulb23/color_region_cache
Fixed colour regions and added local colour region cache
Diffstat (limited to 'scene/gui/text_edit.h')
| -rw-r--r-- | scene/gui/text_edit.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 2360ce79db..30e70bfd0b 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -76,7 +76,6 @@ public: bool marked : 1; bool breakpoint : 1; bool hidden : 1; - int ending_color_region; Map<int, ColorRegionInfo> region_info; String data; }; @@ -103,7 +102,6 @@ public: bool is_breakpoint(int p_line) const { return text[p_line].breakpoint; } void set_hidden(int p_line, bool p_hidden) { text[p_line].hidden = p_hidden; } bool is_hidden(int p_line) const { return text[p_line].hidden; } - int get_line_ending_color_region(int p_line) const { return text[p_line].ending_color_region; } void insert(int p_at, const String &p_text); void remove(int p_at); int size() const { return text.size(); } @@ -189,6 +187,8 @@ private: Size2 size; } cache; + Map<int, int> color_region_cache; + struct TextOperation { enum Type { @@ -368,6 +368,7 @@ private: void _update_caches(); void _cursor_changed_emit(); void _text_changed_emit(); + void _line_edited_from(int p_line); void _push_current_op(); @@ -407,7 +408,7 @@ public: SyntaxHighlighter *_get_syntax_highlighting(); void _set_syntax_highlighting(SyntaxHighlighter *p_syntax_highlighter); - int _get_line_ending_color_region(int p_line) const; + int _is_line_in_region(int p_line); ColorRegion _get_color_region(int p_region) const; Map<int, Text::ColorRegionInfo> _get_line_color_region_info(int p_line) const; |
