commands: Replace all characters in selection

pull/179/head
Wojciech Kępka 3 years ago committed by Blaž Hrastnik
parent 1bffb34350
commit 9c83a98469

@ -472,7 +472,11 @@ pub fn replace(cx: &mut Context) {
let transaction =
Transaction::change_by_selection(doc.text(), doc.selection(view.id), |range| {
(range.from(), range.to() + 1, Some(text.clone()))
(
range.from(),
range.to() + 1,
Some(text.repeat(range.to() - range.from() + 1).into()),
)
});
doc.apply(&transaction, view.id);

Loading…
Cancel
Save