diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-12-09 06:35:29 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-12-09 06:55:15 +0800 |
commit | 70d6c335b17cf166760457e3673aa61098ef0e66 (patch) | |
tree | 3d91c89cff300a9f2717e0e0d36f8ef7369fce12 /src/nvim/edit.c | |
parent | ea39fc2cadc1d87109216da354a876427eeea31a (diff) | |
download | rneovim-70d6c335b17cf166760457e3673aa61098ef0e66.tar.gz rneovim-70d6c335b17cf166760457e3673aa61098ef0e66.tar.bz2 rneovim-70d6c335b17cf166760457e3673aa61098ef0e66.zip |
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)
https://github.com/vim/vim/commit/3f8f82772313af9f2417b06651f30988b63e1c96
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index ac2973ba68..09836e747f 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -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> |