Merge pull request #52671 from Chaosus/fix_delete_line

Fix error which generates if `Delete Line` used on the last line in `CodeEditor`
This commit is contained in:
Rémi Verschelde 2021-09-14 18:23:46 +02:00 committed by GitHub
commit 0232a03177
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1302,7 +1302,9 @@ void CodeTextEditor::_delete_line(int p_line) {
text_editor->set_caret_column(0); text_editor->set_caret_column(0);
} }
text_editor->backspace(); text_editor->backspace();
text_editor->unfold_line(p_line); if (p_line < text_editor->get_line_count()) {
text_editor->unfold_line(p_line);
}
text_editor->set_caret_line(p_line); text_editor->set_caret_line(p_line);
} }