|
|
@ -4017,11 +4017,11 @@ fn surround_replace(cx: &mut Context) {
|
|
|
|
let transaction = Transaction::change(
|
|
|
|
let transaction = Transaction::change(
|
|
|
|
doc.text(),
|
|
|
|
doc.text(),
|
|
|
|
change_pos.iter().enumerate().map(|(i, &pos)| {
|
|
|
|
change_pos.iter().enumerate().map(|(i, &pos)| {
|
|
|
|
if i % 2 == 0 {
|
|
|
|
(
|
|
|
|
(pos, pos + 1, Some(Tendril::from_char(open)))
|
|
|
|
pos,
|
|
|
|
} else {
|
|
|
|
pos + 1,
|
|
|
|
(pos.saturating_sub(1), pos, Some(Tendril::from_char(close)))
|
|
|
|
Some(Tendril::from_char(if i % 2 == 0 { open } else { close })),
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
doc.apply(&transaction, view.id);
|
|
|
|
doc.apply(&transaction, view.id);
|
|
|
|