aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
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/commands
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/commands')
-rw-r--r--helix-term/src/commands/typed.rs5
1 files changed, 5 insertions, 0 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)?;
}