summaryrefslogtreecommitdiff
path: root/src/autocmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-24 19:24:47 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-24 19:24:47 +0000
commitb6db1467622be046dbf00b2213fd9f49f4f3cccb (patch)
tree442a1f5bd1a818ba1667b46b5d588776874b90e6 /src/autocmd.c
parent679140c56bbabf12a199d94f584b1b9dfc9809fd (diff)
downloadvim-git-b6db1467622be046dbf00b2213fd9f49f4f3cccb.tar.gz
patch 8.2.3886: can define autocmd for every event by using "au!"v8.2.3886
Problem: Can define autocmd for every event by using "au!". Solution: Check if a command is present also for "au!".
Diffstat (limited to 'src/autocmd.c')
-rw-r--r--src/autocmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/autocmd.c b/src/autocmd.c
index 789dde1a2..9b6a5d074 100644
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -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;