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!".
diff --git a/src/autocmd.c b/src/autocmd.c
index 789dde1..9b6a5d0 100644
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -967,7 +967,7 @@
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;