summaryrefslogtreecommitdiff
path: root/editor/code_editor.cpp
diff options
context:
space:
mode:
authorRichard Menzies <rdmenzies2000@gmail.com>2020-02-27 21:28:17 +0000
committerRichard Menzies <rdmenzies2000@gmail.com>2020-02-29 16:29:48 +0000
commit28f74327beca86325cb8f8f9c7926a60ea83c826 (patch)
tree73ba5526ea6172e062fc576aecf429a9ea28c9da /editor/code_editor.cpp
parente66d519286693a03bf59eaba0a5f29c1c9b15d64 (diff)
Fix wrong selection on cloning a line down in the editor
Diffstat (limited to 'editor/code_editor.cpp')
-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 948955eabd..7014c79a1e 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -1267,7 +1267,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();