aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-04-01 01:10:59 +0000
committerBlaž Hrastnik2022-04-01 01:11:44 +0000
commit236c6b77077596f8c7b5a5377e23e96ecec45e07 (patch)
treea46edf47cf1c2716b7a76c01e0bb3b04abf1bdb2
parent924462edda05a11f0dc260b516af39c13bee2949 (diff)
fix: copy_selections was broken with selections (not cursors)
-rw-r--r--helix-term/src/commands.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 320bfc94..3c5e0852 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1392,7 +1392,8 @@ fn copy_selection_on_line(cx: &mut Context, direction: Direction) {
if is_primary {
primary_index = ranges.len();
}
- ranges.push(Range::new(anchor, head));
+ // This is Range::new(anchor, head), but it will place the cursor on the correct column
+ ranges.push(Range::point(anchor).put_cursor(text, head, true));
sels += 1;
}