Fix code folding taking into account empty lines, issue 15689
This commit is contained in:
parent
6cbdeedf57
commit
f08eead3a2
1 changed files with 2 additions and 2 deletions
|
@ -5150,7 +5150,7 @@ bool TextEdit::can_fold(int p_line) const {
|
||||||
return false;
|
return false;
|
||||||
if (p_line + 1 >= text.size())
|
if (p_line + 1 >= text.size())
|
||||||
return false;
|
return false;
|
||||||
if (text[p_line].size() == 0)
|
if (text[p_line].strip_edges().size() == 0)
|
||||||
return false;
|
return false;
|
||||||
if (is_folded(p_line))
|
if (is_folded(p_line))
|
||||||
return false;
|
return false;
|
||||||
|
@ -5162,7 +5162,7 @@ bool TextEdit::can_fold(int p_line) const {
|
||||||
int start_indent = get_indent_level(p_line);
|
int start_indent = get_indent_level(p_line);
|
||||||
|
|
||||||
for (int i = p_line + 1; i < text.size(); i++) {
|
for (int i = p_line + 1; i < text.size(); i++) {
|
||||||
if (text[i].size() == 0)
|
if (text[i].strip_edges().size() == 0)
|
||||||
continue;
|
continue;
|
||||||
int next_indent = get_indent_level(i);
|
int next_indent = get_indent_level(i);
|
||||||
if (is_line_comment(i)) {
|
if (is_line_comment(i)) {
|
||||||
|
|
Loading…
Reference in a new issue