summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-10-16 13:26:15 +0200
committerGitHub <noreply@github.com>2018-10-16 13:26:15 +0200
commit40ddab512f9fd94a10d1de90c8d15abf2c1cf0ac (patch)
tree9843b1c5d69a710460d68b83a72a40012ad38b48
parent5d5e591ba14d0a1f4bdf676e9e3f4d21cd03af7a (diff)
parentd47b20acaebddea0a2b9f818a98754b53b041a15 (diff)
Merge pull request #22992 from Paulb23/delete_line_off_by_one
Fixed delete line being off by one, issue 22819
-rw-r--r--editor/code_editor.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 79c22f667a..aeb304d3b9 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -1039,6 +1039,8 @@ void CodeTextEditor::delete_lines() {
int to_line = text_editor->get_selection_to_line();
int from_line = text_editor->get_selection_from_line();
int count = Math::abs(to_line - from_line) + 1;
+
+ text_editor->cursor_set_line(to_line, false);
while (count) {
text_editor->set_line(text_editor->cursor_get_line(), "");
text_editor->backspace_at_cursor();