summaryrefslogtreecommitdiffstats
path: root/src/edit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/edit.c b/src/edit.c
index 05518ceab8..7f4f765012 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -5994,7 +5994,8 @@ ins_apply_autocmds(event_T event)
// If u_savesub() was called then we are not prepared to start
// a new line. Call u_save() with no contents to fix that.
- if (tick != CHANGEDTICK(curbuf))
+ // Except when leaving Insert mode.
+ if (event != EVENT_INSERTLEAVE && tick != CHANGEDTICK(curbuf))
u_save(curwin->w_cursor.lnum, (linenr_T)(curwin->w_cursor.lnum + 1));
return r;