on master help sign in
commands: Replace all characters in selection
9c83a98Wojciech Kępka
helix-term/src/commands.rs+5−1
@@ -472,7 +472,11 @@ pub fn replace(cx: &mut Context) {
472
472
473 let transaction =
473 let transaction =
474 Transaction::change_by_selection(doc.text(), doc.selection(view.id), |range| {
474 Transaction::change_by_selection(doc.text(), doc.selection(view.id), |range| {
475+ (
475− (range.from(), range.to() + 1, Some(text.clone()))
476+ range.from(),
477+ range.to() + 1,
478+ Some(text.repeat(range.to() - range.from() + 1).into()),
479+ )
476 });
480 });
477
481
478 doc.apply(&transaction, view.id);
482 doc.apply(&transaction, view.id);