mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-12-01 19:58:12 +03:00
Fix crash on xa<Enter> if we were on the last line.
This commit is contained in:
parent
fae2127a11
commit
354b822d21
@ -823,6 +823,17 @@ pub fn append_mode(cx: &mut Context) {
|
||||
graphemes::next_grapheme_boundary(text, range.to()), // to() + next char
|
||||
)
|
||||
});
|
||||
|
||||
let end = text.len_chars();
|
||||
|
||||
if selection.iter().any(|range| range.head == end) {
|
||||
let transaction = Transaction::change(
|
||||
doc.text(),
|
||||
vec![(end, end, Some(Tendril::from_char('\n')))].into_iter(),
|
||||
);
|
||||
doc.apply(&transaction, view.id);
|
||||
}
|
||||
|
||||
doc.set_selection(view.id, selection);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user