diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2021-09-14 17:18:20 +0300 |
---|---|---|
committer | Yuri Roubinsky <chaosus89@gmail.com> | 2021-09-14 17:18:20 +0300 |
commit | 7ccbf49bda6f3578bb2b13324a77e39d4e234c2f (patch) | |
tree | 786c24a81e029363b9f02052099e070aa132fb9f | |
parent | 1cec7057bfb2eea0f1c3ac5ab3731f279002e244 (diff) |
Prevent error generates if `Delete Line` used on 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); } |