@@ -429,6 +429,25 @@ pub fn select_line(cx: &mut Context) {
430 doc.set_selection(Selection::single(start, end));
430 doc.set_selection(Selection::single(start, end));
432+pub fn extend_line(cx: &mut Context) {
433+ let count = cx.count;
436+ let pos = doc.selection().primary();
437+ let text = doc.text();
439+ let line_start = text.char_to_line(pos.anchor);
440+ let mut line = text.char_to_line(pos.head);
441+ let line_end = text.line_to_char(line + 1).saturating_sub(1);
442+ if line_start <= pos.anchor && pos.head == line_end && line != text.len_lines() {
446+ let start = text.line_to_char(line_start);
447+ let end = text.line_to_char(line + 1).saturating_sub(1);
449+ doc.set_selection(Selection::single(start, end));
433// heuristic: append changes to history after each command, unless we're in insert mode
452// heuristic: append changes to history after each command, unless we're in insert mode