vim-patch:9.0.1036: undo misbehaves when writing from an insert mode mapping

Problem:    Undo misbehaves when writing from an insert mode mapping.
Solution:   Sync undo when writing. (closes vim/vim#11674)

3f8f827723

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2022-12-09 06:35:29 +08:00
parent ea39fc2cad
commit 70d6c335b1
3 changed files with 70 additions and 0 deletions

View File

@@ -908,6 +908,12 @@ check_pum:
}
pum_want.active = false;
}
if (curbuf->b_u_synced) {
// The K_EVENT, K_COMMAND, or K_LUA caused undo to be synced.
// Need to save the line for undo before inserting the next char.
ins_need_undo = true;
}
break;
case K_HOME: // <Home>