Skip to content

Commit

Permalink
Prevent error generates if Delete Line used on last line in CodeEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaosus committed Sep 14, 2021
1 parent 1cec705 commit 7ccbf49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion editor/code_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 7ccbf49

Please sign in to comment.