diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-27 20:18:31 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-27 20:18:31 +0200 |
commit | db93495d276642f63f80471fbcb900b9aa1e9e42 (patch) | |
tree | fca8ecb1216bbce25b08f87f2ec5857df935ab8b /src/edit.c | |
parent | 0e71704b77a9891ccae9f5a9c7429e933078f232 (diff) | |
download | vim-git-db93495d276642f63f80471fbcb900b9aa1e9e42.tar.gz |
patch 8.2.0649: undo problem whn an InsertLeave autocommand resets undov8.2.0649
Problem: Undo problem whn an InsertLeave autocommand resets undo. (Kutsan
Kaplan)
Solution: Do not create a new undo block when leaving Insert mode.
Diffstat (limited to 'src/edit.c')
-rw-r--r-- | src/edit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/edit.c b/src/edit.c index 05518ceab..7f4f76501 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; |