commands: Replace all characters in selection
This commit is contained in:
parent
1bffb34350
commit
9c83a98469
1 changed files with 5 additions and 1 deletions
|
@ -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…
Reference in a new issue