aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helix-term/src/commands/typed.rs5
-rw-r--r--helix-term/src/ui/editor.rs8
2 files changed, 6 insertions, 7 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index abe6dd97..4b14f5ec 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -355,6 +355,8 @@ fn write_impl(
None
};
+ doc.append_changes_to_history(view);
+
if fmt.is_none() {
let id = doc.id();
cx.editor.save(id, path, force)?;
@@ -732,6 +734,9 @@ pub fn write_all_impl(
None
};
+ let view = view_mut!(cx.editor);
+ doc.append_changes_to_history(view);
+
if fmt.is_none() {
cx.editor.save::<PathBuf>(doc_id, None, force)?;
}
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)
}