From d47b20acaebddea0a2b9f818a98754b53b041a15 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Sat, 13 Oct 2018 18:30:23 +0100 Subject: [PATCH] Fixed delete line being off by one, issue 22819 --- editor/code_editor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 79c22f667a3..aeb304d3b94 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();