mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-23 01:46:18 +04: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
|
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);
|
doc.set_selection(view.id, selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user