summaryrefslogtreecommitdiff
path: root/helix-term/src/ui/editor.rs
diff options
context:
space:
mode:
authorJJ2023-11-01 03:11:31 +0000
committerJJ2023-11-01 04:08:59 +0000
commit49b1f2a869be199aaba97e6a4d74995c5161d7b0 (patch)
tree1b8c89b37be041370ef041542ca4c358f73ca136 /helix-term/src/ui/editor.rs
parentf441f0571f7d8e140384fe75621fa69cec3265c0 (diff)
Fix writes from insert mode not properly updating the revision history
ref: https://github.com/helix-editor/helix/issues/3501 ref: https://github.com/helix-editor/helix/issues/6513 ref: https://github.com/helix-editor/helix/pull/7226
Diffstat (limited to 'helix-term/src/ui/editor.rs')
-rw-r--r--helix-term/src/ui/editor.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 9e30cea4..7afd34f3 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -1311,15 +1311,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)
}