diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-09-14 18:23:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 18:23:46 +0200 |
commit | 0232a031772d929c00d7c8a7947b1b9894ce26fb (patch) | |
tree | 832a8223cbb7fff35011d04a65245c5d5cc1c8dd | |
parent | ed0a3b29dd7d1b4c3f49915ddf38614058e3b88d (diff) | |
parent | 7ccbf49bda6f3578bb2b13324a77e39d4e234c2f (diff) |
Merge pull request #52671 from Chaosus/fix_delete_line
Fix error which generates if `Delete Line` used on the last line in `CodeEditor`
-rw-r--r-- | editor/code_editor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 8aa5d62f98..5599076c40 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1302,7 +1302,9 @@ void CodeTextEditor::_delete_line(int p_line) { text_editor->set_caret_column(0); } 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); } |