From 5d23667a268caa9237f1e17cb2092b387801c547 Mon Sep 17 00:00:00 2001 From: Andreas Liljeqvist Date: Sun, 13 Jun 2021 20:27:03 +0200 Subject: [PATCH] fix offset by one problem in replace_with_yanked --- helix-term/src/commands.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 6111dd7b3..09048f48b 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2240,7 +2240,7 @@ pub fn replace_with_yanked(cx: &mut Context) { let transaction = Transaction::change_by_selection(doc.text(), doc.selection(view.id), |range| { let max_to = doc.text().len_chars().saturating_sub(1); - let to = std::cmp::min(max_to, range.to()); + let to = std::cmp::min(max_to, range.to() + 1); (range.from(), to, Some(yank.as_str().into())) });