0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -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:
Bram Moolenaar
2021-12-24 19:24:47 +00:00
parent 679140c56b
commit b6db146762
4 changed files with 5 additions and 2 deletions

View File

@@ -967,7 +967,7 @@ do_autocmd(exarg_T *eap, char_u *arg_in, int forceit)
last_group = AUGROUP_ERROR; // for listing the group name
if (*arg == '*' || *arg == NUL || *arg == '|')
{
if (!forceit && *cmd != NUL)
if (*cmd != NUL)
emsg(_(e_cannot_define_autocommands_for_all_events));
else
for (event = (event_T)0; (int)event < NUM_EVENTS;