Skip to content

Commit

Permalink
Add changes to history when paste-replacing (helix-editor#9625)
Browse files Browse the repository at this point in the history
  • Loading branch information
scimas authored and postsolar committed Apr 4, 2024
1 parent c4ae70e commit a79aca0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4097,6 +4097,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(
Expand All @@ -4119,6 +4120,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) {
Expand Down

0 comments on commit a79aca0

Please sign in to comment.