diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-07 20:13:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-07 20:13:39 +0800 |
commit | 451b8d6cb1a3110b8c24d2f4b1966daffbaa3dab (patch) | |
tree | 166fc29dbff622076dd2863b7cc8ba089cc4772c | |
parent | 3435cdfb94b6f3c72e7f0f16fef9ff2660377cb2 (diff) | |
parent | 609c0513cac7898782c55f5fb20275733cc566e9 (diff) | |
download | rneovim-451b8d6cb1a3110b8c24d2f4b1966daffbaa3dab.tar.gz rneovim-451b8d6cb1a3110b8c24d2f4b1966daffbaa3dab.tar.bz2 rneovim-451b8d6cb1a3110b8c24d2f4b1966daffbaa3dab.zip |
Merge pull request #20990 from zeertzjq/vim-8.2.2060
vim-patch:8.2.{2060,3626}
-rw-r--r-- | src/nvim/autocmd.c | 4 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_autocmd.vim | 13 | ||||
-rw-r--r-- | src/nvim/testdir/test_compiler.vim | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test_delete.vim | 14 | ||||
-rw-r--r-- | src/nvim/testdir/test_diffmode.vim | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test_fold.vim | 4 |
7 files changed, 23 insertions, 26 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index 5b5ea43d86..9845e6be13 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -779,7 +779,7 @@ void au_event_restore(char *old_ei) // :autocmd * *.c show all autocommands for *.c files. // // Mostly a {group} argument can optionally appear before <event>. -void do_autocmd(char *arg_in, int forceit) +void do_autocmd(exarg_T *eap, char *arg_in, int forceit) { char *arg = arg_in; char *envpat = NULL; @@ -790,6 +790,7 @@ void do_autocmd(char *arg_in, int forceit) int group; if (*arg == '|') { + eap->nextcmd = arg + 1; arg = ""; group = AUGROUP_ALL; // no argument, use all groups } else { @@ -806,6 +807,7 @@ void do_autocmd(char *arg_in, int forceit) pat = skipwhite(pat); if (*pat == '|') { + eap->nextcmd = pat + 1; pat = ""; cmd = ""; } else { diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 5bb7cb2da2..992cd9478d 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -4231,7 +4231,7 @@ static void ex_autocmd(exarg_T *eap) secure = 2; eap->errmsg = _(e_curdir); } else if (eap->cmdidx == CMD_autocmd) { - do_autocmd(eap->arg, eap->forceit); + do_autocmd(eap, eap->arg, eap->forceit); } else { do_augroup(eap->arg, eap->forceit); } diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index 1488fe8431..1e9406eb87 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -481,17 +481,20 @@ endfunc func Test_early_bar() " test that a bar is recognized before the {event} call s:AddAnAutocmd() - augroup vimBarTest | au! | augroup END + augroup vimBarTest | au! | let done = 77 | augroup END call assert_equal(1, len(split(execute('au vimBarTest'), "\n"))) + call assert_equal(77, done) call s:AddAnAutocmd() - augroup vimBarTest| au!| augroup END + augroup vimBarTest| au!| let done = 88 | augroup END call assert_equal(1, len(split(execute('au vimBarTest'), "\n"))) + call assert_equal(88, done) " test that a bar is recognized after the {event} call s:AddAnAutocmd() - augroup vimBarTest| au!BufReadCmd| augroup END + augroup vimBarTest| au!BufReadCmd| let done = 99 | augroup END call assert_equal(1, len(split(execute('au vimBarTest'), "\n"))) + call assert_equal(99, done) " test that a bar is recognized after the {group} call s:AddAnAutocmd() @@ -1975,9 +1978,7 @@ func Test_change_mark_in_autocmds() endfunc func Test_Filter_noshelltemp() - if !executable('cat') - return - endif + CheckExecutable cat enew! call setline(1, ['a', 'b', 'c', 'd']) diff --git a/src/nvim/testdir/test_compiler.vim b/src/nvim/testdir/test_compiler.vim index 3dc8710d63..ec7d143030 100644 --- a/src/nvim/testdir/test_compiler.vim +++ b/src/nvim/testdir/test_compiler.vim @@ -1,9 +1,11 @@ " Test the :compiler command +source check.vim +source shared.vim + func Test_compiler() - if !executable('perl') - return - endif + CheckExecutable perl + CheckFeature quickfix " $LANG changes the output of Perl. if $LANG != '' diff --git a/src/nvim/testdir/test_delete.vim b/src/nvim/testdir/test_delete.vim index b23a3bd025..6b49f153c6 100644 --- a/src/nvim/testdir/test_delete.vim +++ b/src/nvim/testdir/test_delete.vim @@ -1,5 +1,7 @@ " Test for delete(). +source check.vim + func Test_file_delete() split Xfile call setline(1, ['a', 'b']) @@ -41,9 +43,7 @@ func Test_recursive_delete() endfunc func Test_symlink_delete() - if !has('unix') - return - endif + CheckUnix split Xfile call setline(1, ['a', 'b']) wq @@ -56,9 +56,7 @@ func Test_symlink_delete() endfunc func Test_symlink_dir_delete() - if !has('unix') - return - endif + CheckUnix call mkdir('Xdir1') silent !ln -s Xdir1 Xlink call assert_true(isdirectory('Xdir1')) @@ -70,9 +68,7 @@ func Test_symlink_dir_delete() endfunc func Test_symlink_recursive_delete() - if !has('unix') - return - endif + CheckUnix call mkdir('Xdir3') call mkdir('Xdir3/subdir') call mkdir('Xdir4') diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim index 831efdbfc2..0de5310735 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -621,9 +621,7 @@ func Test_diff_move_to() endfunc func Test_diffexpr() - if !executable('diff') - return - endif + CheckExecutable diff func DiffExpr() " Prepend some text to check diff type detection diff --git a/src/nvim/testdir/test_fold.vim b/src/nvim/testdir/test_fold.vim index 0a9be310ff..832dd43b65 100644 --- a/src/nvim/testdir/test_fold.vim +++ b/src/nvim/testdir/test_fold.vim @@ -95,9 +95,7 @@ func Test_indent_fold2() endfunc func Test_manual_fold_with_filter() - if !executable('cat') - return - endif + CheckExecutable cat for type in ['manual', 'marker'] exe 'set foldmethod=' . type new |