summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helix-term/src/commands.rs1
-rw-r--r--helix-term/src/commands/typed.rs4
2 files changed, 5 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 7d5f2241..d1dc9223 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -3746,6 +3746,7 @@ fn paste_impl(
}
doc.apply(&transaction, view.id);
+ doc.append_changes_to_history(view);
}
pub(crate) fn paste_bracketed_value(cx: &mut Context, contents: String) {
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index ec7100a6..f2495d8c 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -913,6 +913,7 @@ fn replace_selections_with_clipboard_impl(
cx: &mut compositor::Context,
clipboard_type: ClipboardType,
) -> anyhow::Result<()> {
+ let scrolloff = cx.editor.config().scrolloff;
let (view, doc) = current!(cx.editor);
match cx.editor.clipboard_provider.get_contents(clipboard_type) {
@@ -924,6 +925,7 @@ fn replace_selections_with_clipboard_impl(
doc.apply(&transaction, view.id);
doc.append_changes_to_history(view);
+ view.ensure_cursor_in_view(doc, scrolloff);
Ok(())
}
Err(e) => Err(e.context("Couldn't get system clipboard contents")),
@@ -1570,6 +1572,7 @@ fn sort_impl(
_args: &[Cow<str>],
reverse: bool,
) -> anyhow::Result<()> {
+ let scrolloff = cx.editor.config().scrolloff;
let (view, doc) = current!(cx.editor);
let text = doc.text().slice(..);
@@ -1595,6 +1598,7 @@ fn sort_impl(
doc.apply(&transaction, view.id);
doc.append_changes_to_history(view);
+ view.ensure_cursor_in_view(doc, scrolloff);
Ok(())
}