@@ -429,6 +429,25 @@ pub fn select_line(cx: &mut Context) {
429429
430430 doc.set_selection(Selection::single(start, end));
431431}
432+pub fn extend_line(cx: &mut Context) {
433+ let count = cx.count;
434+ let doc = cx.doc();
435+
436+ let pos = doc.selection().primary();
437+ let text = doc.text();
438+
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() {
443+ line += 1;
444+ }
445+
446+ let start = text.line_to_char(line_start);
447+ let end = text.line_to_char(line + 1).saturating_sub(1);
448+
449+ doc.set_selection(Selection::single(start, end));
450+}
432451
433452// heuristic: append changes to history after each command, unless we're in insert mode
434453