@@ -410,8 +410,7 @@ fn extend_line_down(cx: &mut Context) {
410 move_impl(cx, move_vertically, Direction::Forward, Movement::Extend)
410 move_impl(cx, move_vertically, Direction::Forward, Movement::Extend)
413−fn goto_line_end_impl(cx: &mut Context, movement: Movement) {
413+fn goto_line_end_impl(view: &mut View, doc: &mut Document, movement: Movement) {
414− let (view, doc) = current!(cx.editor);
415 let text = doc.text().slice(..);
414 let text = doc.text().slice(..);
417 let selection = doc.selection(view.id).clone().transform(|range| {
416 let selection = doc.selection(view.id).clone().transform(|range| {
@@ -427,15 +426,24 @@ fn goto_line_end_impl(cx: &mut Context, movement: Movement) {
429fn goto_line_end(cx: &mut Context) {
428fn goto_line_end(cx: &mut Context) {
429+ let (view, doc) = current!(cx.editor);
430− goto_line_end_impl(cx, Movement::Move)
430+ goto_line_end_impl(
433+ if doc.mode == Mode::Select {
433fn extend_to_line_end(cx: &mut Context) {
441fn extend_to_line_end(cx: &mut Context) {
434− goto_line_end_impl(cx, Movement::Extend)
442+ let (view, doc) = current!(cx.editor);
443+ goto_line_end_impl(view, doc, Movement::Extend)
437−fn goto_line_end_newline_impl(cx: &mut Context, movement: Movement) {
446+fn goto_line_end_newline_impl(view: &mut View, doc: &mut Document, movement: Movement) {
438− let (view, doc) = current!(cx.editor);
439 let text = doc.text().slice(..);
447 let text = doc.text().slice(..);
441 let selection = doc.selection(view.id).clone().transform(|range| {
449 let selection = doc.selection(view.id).clone().transform(|range| {
@@ -448,15 +456,24 @@ fn goto_line_end_newline_impl(cx: &mut Context, movement: Movement) {
450fn goto_line_end_newline(cx: &mut Context) {
458fn goto_line_end_newline(cx: &mut Context) {
459+ let (view, doc) = current!(cx.editor);
451− goto_line_end_newline_impl(cx, Movement::Move)
460+ goto_line_end_newline_impl(
463+ if doc.mode == Mode::Select {
454fn extend_to_line_end_newline(cx: &mut Context) {
471fn extend_to_line_end_newline(cx: &mut Context) {
455− goto_line_end_newline_impl(cx, Movement::Extend)
472+ let (view, doc) = current!(cx.editor);
473+ goto_line_end_newline_impl(view, doc, Movement::Extend)
458−fn goto_line_start_impl(cx: &mut Context, movement: Movement) {
476+fn goto_line_start_impl(view: &mut View, doc: &mut Document, movement: Movement) {
459− let (view, doc) = current!(cx.editor);
460 let text = doc.text().slice(..);
477 let text = doc.text().slice(..);
462 let selection = doc.selection(view.id).clone().transform(|range| {
479 let selection = doc.selection(view.id).clone().transform(|range| {
@@ -470,11 +487,21 @@ fn goto_line_start_impl(cx: &mut Context, movement: Movement) {
472fn goto_line_start(cx: &mut Context) {
489fn goto_line_start(cx: &mut Context) {
490+ let (view, doc) = current!(cx.editor);
473− goto_line_start_impl(cx, Movement::Move)
491+ goto_line_start_impl(
494+ if doc.mode == Mode::Select {
476fn extend_to_line_start(cx: &mut Context) {
502fn extend_to_line_start(cx: &mut Context) {
477− goto_line_start_impl(cx, Movement::Extend)
503+ let (view, doc) = current!(cx.editor);
504+ goto_line_start_impl(view, doc, Movement::Extend)
480fn goto_first_nonwhitespace(cx: &mut Context) {
507fn goto_first_nonwhitespace(cx: &mut Context) {