fix incorrect iauto-indentation in mutliline bracket (fix #46384)

This commit is contained in:
jmb462 2021-03-03 18:59:59 +01:00
parent 4d1f83a621
commit f05d6f66b0
1 changed files with 8 additions and 3 deletions

View File

@ -2199,9 +2199,14 @@ void TextEdit::_new_line(bool p_split_current_line, bool p_above) {
// No need to move the brace below if we are not taking the text with us.
char32_t closing_char = _get_right_pair_symbol(indent_char);
if ((closing_char != 0) && (closing_char == text[cursor.line][cursor.column]) && !p_split_current_line) {
brace_indent = true;
ins += "\n" + ins.substr(1, ins.length() - 2);
if ((closing_char != 0) && (closing_char == text[cursor.line][cursor.column])) {
if (p_split_current_line) {
brace_indent = true;
ins += "\n" + ins.substr(1, ins.length() - 2);
} else {
brace_indent = false;
ins = "\n" + ins.substr(1, ins.length() - 2);
}
}
}
}