Skip to content

Commit

Permalink
Write pre-manipulation pastes to the revision history
Browse files Browse the repository at this point in the history
  • Loading branch information
omentic committed Nov 1, 2023
1 parent e0a8778 commit 8adc281
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1362,17 +1362,11 @@ impl Component for EditorView {
// if the focused view still exists and wasn't closed
if cx.editor.tree.contains(focus) {
let config = cx.editor.config();
let mode = cx.editor.mode();
let view = view_mut!(cx.editor, focus);
let doc = doc_mut!(cx.editor, &view.doc);

view.ensure_cursor_in_view(doc, config.scrolloff);

// Store a history state if not in insert mode. This also takes care of
// committing changes when leaving insert mode.
if mode != Mode::Insert {
doc.append_changes_to_history(view);
}
doc.append_changes_to_history(view);
}

EventResult::Consumed(callback)
Expand Down

0 comments on commit 8adc281

Please sign in to comment.