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 Jun 4, 2023
1 parent 9c4369d commit e2a8774
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 @@ -1235,15 +1235,9 @@ impl Component for EditorView {
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);

// Store a history state if not in insert mode. Otherwise wait till we exit insert
// to include any edits to the paste in the history state.
if mode != Mode::Insert {
doc.append_changes_to_history(view);
}
doc.append_changes_to_history(view);

EventResult::Consumed(None)
}
Expand Down

0 comments on commit e2a8774

Please sign in to comment.