From 236c6b77077596f8c7b5a5377e23e96ecec45e07 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 1 Apr 2022 10:10:59 +0900 Subject: fix: copy_selections was broken with selections (not cursors) --- helix-term/src/commands.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'helix-term') 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; } -- cgit v1.2.3-70-g09d2