diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 0840749f89011..9cf816358b0fc 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -1241,12 +1241,17 @@ impl Component for EditorView { match event { Event::Paste(contents) => { + let mode = cx.editor.mode(); + if mode == Mode::Insert { + let (view, doc) = current!(cx.editor); + doc.append_changes_to_history(view); + } + cx.count = cx.editor.count; commands::paste_bracketed_value(&mut cx, contents.clone()); cx.editor.count = None; let config = cx.editor.config(); - let mode = cx.editor.mode(); let (view, doc) = current!(cx.editor); view.ensure_cursor_in_view(doc, config.scrolloff);