on master help sign in
fix offset by one problem in replace_with_yanked
5d23667Andreas Liljeqvist
helix-term/src/commands.rs+1−1
@@ -2240,7 +2240,7 @@ pub fn replace_with_yanked(cx: &mut Context) {
2240 let transaction =
2240 let transaction =
2241 Transaction::change_by_selection(doc.text(), doc.selection(view.id), |range| {
2241 Transaction::change_by_selection(doc.text(), doc.selection(view.id), |range| {
2242 let max_to = doc.text().len_chars().saturating_sub(1);
2242 let max_to = doc.text().len_chars().saturating_sub(1);
2243− let to = std::cmp::min(max_to, range.to());
2243+ let to = std::cmp::min(max_to, range.to() + 1);
2244 (range.from(), to, Some(yank.as_str().into()))
2244 (range.from(), to, Some(yank.as_str().into()))
2245 });
2245 });
2246
2246