From 367048030bdd6b35bde0b0d56c17dfe27565433e Mon Sep 17 00:00:00 2001 From: Richard Menzies Date: Thu, 27 Feb 2020 21:28:17 +0000 Subject: [PATCH] Fix wrong selection on cloning a line down in the editor (cherry picked from commit 28f74327beca86325cb8f8f9c7926a60ea83c826) --- editor/code_editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index d0e69b7adc8..7818f854844 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1261,7 +1261,7 @@ void CodeTextEditor::clone_lines_down() { text_editor->cursor_set_line(cursor_new_line); text_editor->cursor_set_column(cursor_new_column); if (selection_active) { - text_editor->select(to_line, to_column, 2 * to_line - from_line, 2 * to_column - from_column); + text_editor->select(to_line, to_column, 2 * to_line - from_line, to_line == from_line ? 2 * to_column - from_column : to_column); } text_editor->end_complex_operation();