vim-patch:8.2.0649: undo problem whn an InsertLeave autocommand resets undo

Problem:    Undo problem whn an InsertLeave autocommand resets undo. (Kutsan
            Kaplan)
Solution:   Do not create a new undo block when leaving Insert mode.
db93495d27
This commit is contained in:
Jan Edmund Lazo
2020-04-28 19:05:07 -04:00
parent a576bf6196
commit cf9887c838
2 changed files with 18 additions and 2 deletions

View File

@@ -9129,7 +9129,8 @@ static int 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 != buf_get_changedtick(curbuf)) {
// Except when leaving Insert mode.
if (event != EVENT_INSERTLEAVE && tick != buf_get_changedtick(curbuf)) {
u_save(curwin->w_cursor.lnum, (linenr_T)(curwin->w_cursor.lnum + 1));
}