aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorAndreas Liljeqvist2021-06-13 18:27:03 +0000
committerBlaž Hrastnik2021-06-14 00:58:40 +0000
commit5d23667a268caa9237f1e17cb2092b387801c547 (patch)
tree9e64188f5c9b501142c5d6b62ccd30b25d9a9aa8 /helix-term
parentb6e363ef0e39251a98d30758fe78790469bdfe70 (diff)
fix offset by one problem in replace_with_yanked
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 6111dd7b..09048f48 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()))
});