diff src/autocmd.c @ 26715:af919f98c7e1 v8.2.3886

patch 8.2.3886: can define autocmd for every event by using "au!" Commit: https://github.com/vim/vim/commit/b6db1467622be046dbf00b2213fd9f49f4f3cccb Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 24 19:24:47 2021 +0000 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!".
author Bram Moolenaar <Bram@vim.org>
date Fri, 24 Dec 2021 20:30:03 +0100
parents d1a60043826c
children df2de1e63de0
line wrap: on
line diff
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -967,7 +967,7 @@ do_autocmd(exarg_T *eap, char_u *arg_in,
     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;