|
|
|
@ -1668,6 +1668,9 @@ fn open(cx: &mut Context, open: Open) {
|
|
|
|
|
let mut ranges = SmallVec::with_capacity(selection.len());
|
|
|
|
|
let mut offs = 0;
|
|
|
|
|
|
|
|
|
|
let mut transaction = Transaction::change_by_selection(contents, selection, |range| {
|
|
|
|
|
let line = text.char_to_line(range.head);
|
|
|
|
|
|
|
|
|
|
let line = match open {
|
|
|
|
|
// adjust position to the end of the line (next line - 1)
|
|
|
|
|
Open::Below => line + 1,
|
|
|
|
@ -1675,9 +1678,6 @@ fn open(cx: &mut Context, open: Open) {
|
|
|
|
|
Open::Above => line,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let mut transaction = Transaction::change_by_selection(contents, selection, |range| {
|
|
|
|
|
let line = text.char_to_line(range.head);
|
|
|
|
|
|
|
|
|
|
// insert newlines after this index for both Above and Below variants
|
|
|
|
|
let linend_index = doc.text().line_to_char(line).saturating_sub(1);
|
|
|
|
|
|
|
|
|
|