@@ -1668,16 +1668,16 @@ fn open(cx: &mut Context, open: Open) {
16681668 let mut ranges = SmallVec::with_capacity(selection.len());
16691669 let mut offs = 0;
16701670
1671− let line = match open {
1672− // adjust position to the end of the line (next line - 1)
1673− Open::Below => line + 1,
1674− // adjust position to the end of the previous line (current line - 1)
1675− Open::Above => line,
1676− };
1677−
16781671 let mut transaction = Transaction::change_by_selection(contents, selection, |range| {
16791672 let line = text.char_to_line(range.head);
16801673
1674+ let line = match open {
1675+ // adjust position to the end of the line (next line - 1)
1676+ Open::Below => line + 1,
1677+ // adjust position to the end of the previous line (current line - 1)
1678+ Open::Above => line,
1679+ };
1680+
16811681 // insert newlines after this index for both Above and Below variants
16821682 let linend_index = doc.text().line_to_char(line).saturating_sub(1);
16831683