Skip to content

Commit

Permalink
Add changes to history when paste-replacing (#9625)
Browse files Browse the repository at this point in the history
  • Loading branch information
scimas authored Feb 13, 2024
1 parent fe869e5 commit c59f299
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 @@ -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(
Expand All @@ -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) {
Expand Down

0 comments on commit c59f299

Please sign in to comment.