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 /modules/gdscript | |
parent | ea0e73f3c8be433dba3b98808b57dd1e2ca4d934 (diff) | |
parent | b571a29df563133e9dfde738c6020c9111729ef6 (diff) |
Merge pull request #18040 from Paulb23/color_region_cache
Fixed colour regions and added local colour region cache
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_highlighter.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/modules/gdscript/gdscript_highlighter.cpp b/modules/gdscript/gdscript_highlighter.cpp index 5b8b652c29..4e89851bf2 100644 --- a/modules/gdscript/gdscript_highlighter.cpp +++ b/modules/gdscript/gdscript_highlighter.cpp @@ -71,24 +71,8 @@ Map<int, TextEdit::HighlighterInfo> GDScriptSyntaxHighlighter::_get_line_syntax_ Color keyword_color; Color color; - int in_region = -1; + int in_region = text_editor->_is_line_in_region(p_line); int deregion = 0; - for (int i = 0; i < p_line; i++) { - int ending_color_region = text_editor->_get_line_ending_color_region(i); - if (in_region == -1) { - in_region = ending_color_region; - } else if (in_region == ending_color_region) { - in_region = -1; - } else { - const Map<int, TextEdit::Text::ColorRegionInfo> &cri_map = text_editor->_get_line_color_region_info(i); - for (const Map<int, TextEdit::Text::ColorRegionInfo>::Element *E = cri_map.front(); E; E = E->next()) { - const TextEdit::Text::ColorRegionInfo &cri = E->get(); - if (cri.region == in_region) { - in_region = -1; - } - } - } - } const Map<int, TextEdit::Text::ColorRegionInfo> cri_map = text_editor->_get_line_color_region_info(p_line); const String &str = text_editor->get_line(p_line); |