@@ -2292,8 +2292,10 @@ fn open(cx: &mut Context, open: Open) {
2292 let mut offs = 0;
2292 let mut offs = 0;
2294 let mut transaction = Transaction::change_by_selection(contents, selection, |range| {
2294 let mut transaction = Transaction::change_by_selection(contents, selection, |range| {
2295− let cursor_line = range.cursor_line(text);
2295+ let cursor_line = text.char_to_line(match open {
2296−
2296+ Open::Below => graphemes::prev_grapheme_boundary(text, range.to()),
2297+ Open::Above => range.from(),
2297 let new_line = match open {
2299 let new_line = match open {
2298 // adjust position to the end of the line (next line - 1)
2300 // adjust position to the end of the line (next line - 1)
2299 Open::Below => cursor_line + 1,
2301 Open::Below => cursor_line + 1,