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