@@ -922,18 +922,25 @@ fn selection_lines(doc: &Rope, selection: &Selection) -> Vec<usize> {
922922
923923// I inserts at the start of each line with a selection
924924pub fn prepend_to_line(cx: &mut Context) {
925+ move_line_start(cx);
925926 let doc = cx.doc();
926927 enter_insert_mode(doc);
927−
928− move_line_start(cx);
929928}
930929
931930// A inserts at the end of each line with a selection
932931pub fn append_to_line(cx: &mut Context) {
932+ move_line_end(cx);
933+
933934 let doc = cx.doc();
934935 enter_insert_mode(doc);
935936
936− move_line_end(cx);
937+ // offset by another 1 char since move_line_end will position on the last char, we want to
938+ // append past that
939+ let selection = doc.selection().transform(|range| {
940+ let pos = range.head + 1;
941+ Range::new(pos, pos)
942+ });
943+ doc.set_selection(selection);
937944}
938945
939946// o inserts a new line after each line with a selection