on master help sign in
Fix crash on xa<Enter> if we were on the last line.
354b822Blaž Hrastnik
helix-term/src/commands.rs+11
@@ -823,6 +823,17 @@ pub fn append_mode(cx: &mut Context) {
823 graphemes::next_grapheme_boundary(text, range.to()), // to() + next char
823 graphemes::next_grapheme_boundary(text, range.to()), // to() + next char
824 )
824 )
825 });
825 });
826+
827+ let end = text.len_chars();
828+
829+ if selection.iter().any(|range| range.head == end) {
830+ let transaction = Transaction::change(
831+ doc.text(),
832+ vec![(end, end, Some(Tendril::from_char('\n')))].into_iter(),
833+ );
834+ doc.apply(&transaction, view.id);
835+ }
836+
826 doc.set_selection(view.id, selection);
837 doc.set_selection(view.id, selection);
827}
838}
828
839