summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-03-01 15:53:55 +0100
committerGitHub <noreply@github.com>2020-03-01 15:53:55 +0100
commit55396d6e06f8e4e355e9ab0595bdb7f27c1c36dd (patch)
tree9990e15384ef58c7efafa7252fdb0032847c1004
parent0e25f54755a5e37fe64e328b7cd3ce4058245f09 (diff)
parent28f74327beca86325cb8f8f9c7926a60ea83c826 (diff)
Merge pull request #36621 from WizardOhio24/fix-wrong-selection-on-line-clone-down
Fix wrong selection on cloning a line down in the editor
-rw-r--r--editor/code_editor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index c8f7e88082..fd50ba0d08 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -1257,7 +1257,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();