on master help sign in
fix: ok, needs to be the end of the previous line
commit0f55e67576ef6b9cd0c560100db43cb3023c5ef7 authorBlaž Hrastnik <blaz@mxxn.io> dateThu 24 Jun 2021, 01:35 (5 years ago) parent7366fe8
1 file changed+1−1
helix-term/src/commands.rs+1−1
helix-term/src/commands.rs+1−1
@@ -1826,7 +1826,7 @@ fn open(cx: &mut Context, open: Open) {
18261826 };
18271827
18281828 // insert newlines after this index for both Above and Below variants
1829− let line_end_index = line_end_char_index(&doc.text().slice(..), line);
1829+ let line_end_index = line_end_char_index(&doc.text().slice(..), line.saturating_sub(1));
18301830
18311831 // TODO: share logic with insert_newline for indentation
18321832 let indent_level = indent::suggested_indent_for_pos(