mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.3886: can define autocmd for every event by using "au!"
Problem: Can define autocmd for every event by using "au!". Solution: Check if a command is present also for "au!".
This commit is contained in:
parent
679140c56b
commit
b6db146762
@ -967,7 +967,7 @@ do_autocmd(exarg_T *eap, char_u *arg_in, int forceit)
|
|||||||
last_group = AUGROUP_ERROR; // for listing the group name
|
last_group = AUGROUP_ERROR; // for listing the group name
|
||||||
if (*arg == '*' || *arg == NUL || *arg == '|')
|
if (*arg == '*' || *arg == NUL || *arg == '|')
|
||||||
{
|
{
|
||||||
if (!forceit && *cmd != NUL)
|
if (*cmd != NUL)
|
||||||
emsg(_(e_cannot_define_autocommands_for_all_events));
|
emsg(_(e_cannot_define_autocommands_for_all_events));
|
||||||
else
|
else
|
||||||
for (event = (event_T)0; (int)event < NUM_EVENTS;
|
for (event = (event_T)0; (int)event < NUM_EVENTS;
|
||||||
|
@ -581,7 +581,7 @@ endfunc
|
|||||||
|
|
||||||
func Test_clear_arglist_in_all()
|
func Test_clear_arglist_in_all()
|
||||||
n 0 00 000 0000 00000 000000
|
n 0 00 000 0000 00000 000000
|
||||||
au! * 0 n 0
|
au WinNew 0 n 0
|
||||||
call assert_fails("all", "E1156")
|
call assert_fails("all", "E1156")
|
||||||
au! *
|
au! *
|
||||||
endfunc
|
endfunc
|
||||||
|
@ -1896,6 +1896,7 @@ endfunc
|
|||||||
func Test_autocommand_all_events()
|
func Test_autocommand_all_events()
|
||||||
call assert_fails('au * * bwipe', 'E1155:')
|
call assert_fails('au * * bwipe', 'E1155:')
|
||||||
call assert_fails('au * x bwipe', 'E1155:')
|
call assert_fails('au * x bwipe', 'E1155:')
|
||||||
|
call assert_fails('au! * x bwipe', 'E1155:')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
function s:Before_test_dirchanged()
|
function s:Before_test_dirchanged()
|
||||||
|
@ -749,6 +749,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3886,
|
||||||
/**/
|
/**/
|
||||||
3885,
|
3885,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user