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