diff options
author | Wojciech Kępka | 2021-06-07 16:49:27 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-06-08 08:23:38 +0000 |
commit | 9c83a98469927e310fcd24ad8fcf13a719609d5f (patch) | |
tree | baee12d88addc5a954883696e08ff57b5f82c9ae /helix-term/src | |
parent | 1bffb34350343eb6887e32c7fbe1d51e9fce858e (diff) |
commands: Replace all characters in selection
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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); |