diff options
author | Paulb23 <p_batty@hotmail.co.uk> | 2018-09-29 18:08:56 +0100 |
---|---|---|
committer | Paulb23 <p_batty@hotmail.co.uk> | 2018-09-29 18:08:56 +0100 |
commit | f08eead3a2d106fe6f45ca7f759763b6f213e306 (patch) | |
tree | 93ccae7c40f3c6da391c6ca4b95899cb099dfc95 /scene | |
parent | 6cbdeedf57c7383827416da19b6026e3721f2812 (diff) |
Fix code folding taking into account empty lines, issue 15689
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/text_edit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 632a686256..9fe306c236 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -5150,7 +5150,7 @@ bool TextEdit::can_fold(int p_line) const { return false; if (p_line + 1 >= text.size()) return false; - if (text[p_line].size() == 0) + if (text[p_line].strip_edges().size() == 0) return false; if (is_folded(p_line)) return false; @@ -5162,7 +5162,7 @@ bool TextEdit::can_fold(int p_line) const { int start_indent = get_indent_level(p_line); for (int i = p_line + 1; i < text.size(); i++) { - if (text[i].size() == 0) + if (text[i].strip_edges().size() == 0) continue; int next_indent = get_indent_level(i); if (is_line_comment(i)) { |