mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 01:16:18 +04:00
fix offset by one problem in replace_with_yanked
This commit is contained in:
parent
b6e363ef0e
commit
5d23667a26
@ -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()))
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user