diff options
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/editor.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 040e746d..89fa3c6e 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -1035,6 +1035,12 @@ impl Component for EditorView { let (view, doc) = current!(cx.editor); view.ensure_cursor_in_view(doc, cx.editor.config.scrolloff); + // Store a history state if not in insert mode. This also takes care of + // commiting changes when leaving insert mode. + if doc.mode() != Mode::Insert { + doc.append_changes_to_history(view.id); + } + // mode transitions match (mode, doc.mode()) { (Mode::Normal, Mode::Insert) => { |