diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index c9e35062..193d5d40 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1414,7 +1414,7 @@ fn copy_selection_on_line(cx: &mut Context, direction: Direction) { let (head, anchor) = if range.anchor < range.head { (range.head - 1, range.anchor) } else { - (range.head, range.anchor - 1) + (range.head, range.anchor.saturating_sub(1)) }; let tab_width = doc.tab_width();