on master help sign in
fix merge issue
1e80fbbJan Hrastnik
helix-term/src/commands.rs+7−7
@@ -1668,16 +1668,16 @@ fn open(cx: &mut Context, open: Open) {
1668 let mut ranges = SmallVec::with_capacity(selection.len());
1668 let mut ranges = SmallVec::with_capacity(selection.len());
1669 let mut offs = 0;
1669 let mut offs = 0;
1670
1670
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−
1678 let mut transaction = Transaction::change_by_selection(contents, selection, |range| {
1671 let mut transaction = Transaction::change_by_selection(contents, selection, |range| {
1679 let line = text.char_to_line(range.head);
1672 let line = text.char_to_line(range.head);
1680
1673
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+
1681 // insert newlines after this index for both Above and Below variants
1681 // insert newlines after this index for both Above and Below variants
1682 let linend_index = doc.text().line_to_char(line).saturating_sub(1);
1682 let linend_index = doc.text().line_to_char(line).saturating_sub(1);
1683
1683