@@ -900,14 +900,13 @@ fn extend_line(cx: &mut Context) {
900 let text = doc.text();
900 let text = doc.text();
902 let line_start = text.char_to_line(pos.anchor);
902 let line_start = text.char_to_line(pos.anchor);
903− let mut line = text.char_to_line(pos.head);
904− let line_end = line_end_char_index(&text.slice(..), line);
905− if line_start <= pos.anchor && pos.head == line_end && line < (text.len_lines() - 2) {
909 let start = text.line_to_char(line_start);
903 let start = text.line_to_char(line_start);
904+ let line_end = text.char_to_line(pos.head);
910− let end = line_end_char_index(&text.slice(..), line);
905+ let mut end = line_end_char_index(&text.slice(..), line_end);
907+ if pos.anchor == start && pos.head == end && line_end < (text.len_lines() - 2) {
908+ end = line_end_char_index(&text.slice(..), line_end + 1);
912 doc.set_selection(view.id, Selection::single(start, end));
911 doc.set_selection(view.id, Selection::single(start, end));