diff options
author | Mihir Gadgil | 2024-02-13 16:16:23 +0000 |
---|---|---|
committer | GitHub | 2024-02-13 16:16:23 +0000 |
commit | c59f29921da98e23525c9ff4ffa82e330310e6fe (patch) | |
tree | 90c88deca7aca6c9edf06af88b8a743ab62a8c0d /helix-term | |
parent | fe869e5dc7a8cd6c2c2e3945816bd890956eef3a (diff) |
Add changes to history when paste-replacing (#9625)
Diffstat (limited to 'helix-term')
-rw-r--r-- | helix-term/src/commands.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index d44f477b..e46109c0 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -4084,6 +4084,7 @@ fn replace_with_yanked_impl(editor: &mut Editor, register: char, count: usize) { return; }; let values: Vec<_> = values.map(|value| value.to_string()).collect(); + let scrolloff = editor.config().scrolloff; let (view, doc) = current!(editor); let repeat = std::iter::repeat( @@ -4106,6 +4107,8 @@ fn replace_with_yanked_impl(editor: &mut Editor, register: char, count: usize) { }); doc.apply(&transaction, view.id); + doc.append_changes_to_history(view); + view.ensure_cursor_in_view(doc, scrolloff); } fn replace_selections_with_clipboard(cx: &mut Context) { |