diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-04-03 21:09:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-03 21:09:26 -0400 |
commit | 0dfb4e2765c833557eb78ebee029e9b6a8c8bd26 (patch) | |
tree | d4f586c6a1ac804856a367b58f0c05c7dbf0c04f /src | |
parent | 804ea22944146a6607859dbfcf35d24946b065e2 (diff) | |
parent | 53cceda52da3f640f883479693267b45c9237107 (diff) | |
download | rneovim-0dfb4e2765c833557eb78ebee029e9b6a8c8bd26.tar.gz rneovim-0dfb4e2765c833557eb78ebee029e9b6a8c8bd26.tar.bz2 rneovim-0dfb4e2765c833557eb78ebee029e9b6a8c8bd26.zip |
Merge pull request #14282 from janlazo/vim-8.2.2695
vim-patch:8.2.{2695,2697,2700,2701,2702}
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/autocmd.c | 12 | ||||
-rw-r--r-- | src/nvim/testdir/test_compiler.vim | 4 |
2 files changed, 12 insertions, 4 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); diff --git a/src/nvim/testdir/test_compiler.vim b/src/nvim/testdir/test_compiler.vim index d361205baa..c3de7d0050 100644 --- a/src/nvim/testdir/test_compiler.vim +++ b/src/nvim/testdir/test_compiler.vim @@ -60,10 +60,10 @@ func Test_compiler_completion() call assert_match('^"compiler ' .. clist .. '$', @:) call feedkeys(":compiler p\<C-A>\<C-B>\"\<CR>", 'tx') - call assert_equal('"compiler pbx perl php pylint pyunit', @:) + call assert_match('"compiler pbx perl\( p[a-z]\+\)\+ pylint pyunit', @:) call feedkeys(":compiler! p\<C-A>\<C-B>\"\<CR>", 'tx') - call assert_equal('"compiler! pbx perl php pylint pyunit', @:) + call assert_match('"compiler! pbx perl\( p[a-z]\+\)\+ pylint pyunit', @:) endfunc func Test_compiler_error() |