mirror of https://github.com/helix-editor/helix
commands: Replace all characters in selection
parent
1bffb34350
commit
9c83a98469
|
@ -472,7 +472,11 @@ pub fn replace(cx: &mut Context) {
|
||||||
|
|
||||||
let transaction =
|
let transaction =
|
||||||
Transaction::change_by_selection(doc.text(), doc.selection(view.id), |range| {
|
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);
|
doc.apply(&transaction, view.id);
|
||||||
|
|
Loading…
Reference in New Issue