commands: Replace all characters in selection
commit9c83a98469927e310fcd24ad8fcf13a719609d5f
authorWojciech Kępka <wojtek.kepka@protonmail.com>
dateMon 7 Jun 2021, 18:49 (5 years ago)
parent1bffb34
helix-term/src/commands.rs+5−1
@@ -472,7 +472,11 @@ pub fn replace(cx: &mut Context) {
472472
473473 let transaction =
474474 Transaction::change_by_selection(doc.text(), doc.selection(view.id), |range| {
475− (range.from(), range.to() + 1, Some(text.clone()))
475+ (
476+ range.from(),
477+ range.to() + 1,
478+ Some(text.repeat(range.to() - range.from() + 1).into()),
479+ )
476480 });
477481
478482 doc.apply(&transaction, view.id);