diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-04-03 09:00:01 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-04-03 20:25:59 -0400 |
commit | 3a623fd5cf79738eb907586ecd5450722e495574 (patch) | |
tree | f6ff64f1472321c1773f440db3a875651ce6490c /src | |
parent | abdda664108646a8f1bd3112abb8083d721d38e6 (diff) | |
download | rneovim-3a623fd5cf79738eb907586ecd5450722e495574.tar.gz rneovim-3a623fd5cf79738eb907586ecd5450722e495574.tar.bz2 rneovim-3a623fd5cf79738eb907586ecd5450722e495574.zip |
vim-patch:8.2.2695: cursor position reset with nested autocommands
Problem: Cursor position reset with nested autocommands.
Solution: Only check and reset line numbers for not nested autocommands.
(closes vim/vim#5820)
https://github.com/vim/vim/commit/1e6bbfb5607c82d872070219c26e2aae20db68ed
N/A patches for version.c:
vim-patch:8.2.2700: nested autocmd test fails sometimes
Problem: Nested autocmd test fails sometimes.
Solution: Wait for the job to finish.
https://github.com/vim/vim/commit/6437475ffb421d6ac35572aa779ff24b70c5206b
vim-patch:8.2.2701: order of removing FORTIFY_SOURCE is wrong
Problem: Order of removing FORTIFY_SOURCE is wrong.
Solution: Use the more specific pattern first.
https://github.com/vim/vim/commit/26f201345dadef2a048db5aea804f6c1b54f1a0b
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/autocmd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index f71075ae74..145f6f5601 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -1621,13 +1621,21 @@ static bool apply_autocmds_group(event_T event, ap->last = false; } ap->last = true; - check_lnums(true); // make sure cursor and topline are valid + + if (nesting == 1) { + // make sure cursor and topline are valid + check_lnums(true); + } // Execute the autocmd. The `getnextac` callback handles iteration. do_cmdline(NULL, getnextac, (void *)&patcmd, DOCMD_NOWAIT | DOCMD_VERBOSE | DOCMD_REPEAT); - reset_lnums(); // restore cursor and topline, unless they were changed + if (nesting == 1) { + // restore cursor and topline, unless they were changed + reset_lnums(); + } + if (eap != NULL) { (void)set_cmdarg(NULL, save_cmdarg); |