aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helix-term/src/commands.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 3476e901..fc3c2561 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -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);
}