From 9c83a98469927e310fcd24ad8fcf13a719609d5f Mon Sep 17 00:00:00 2001 From: Wojciech Kępka Date: Mon, 7 Jun 2021 18:49:27 +0200 Subject: commands: Replace all characters in selection --- helix-term/src/commands.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index d8e377c8..d34afda4 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -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); -- cgit v1.2.3-70-g09d2