mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
patch 8.2.2420: too many problems with using all autocommand events
Problem: Too many problems with using all autocommand events. Solution: Disallow defining an autocommand for all events.
This commit is contained in:
@@ -956,11 +956,14 @@ do_autocmd(char_u *arg_in, int forceit)
|
||||
last_group = AUGROUP_ERROR; // for listing the group name
|
||||
if (*arg == '*' || *arg == NUL || *arg == '|')
|
||||
{
|
||||
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
|
||||
event = (event_T)((int)event + 1))
|
||||
if (do_autocmd_event(event, pat,
|
||||
once, nested, cmd, forceit, group) == FAIL)
|
||||
break;
|
||||
if (!forceit && *cmd != NUL)
|
||||
emsg(_(e_cannot_define_autocommands_for_all_events));
|
||||
else
|
||||
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
|
||||
event = (event_T)((int)event + 1))
|
||||
if (do_autocmd_event(event, pat,
|
||||
once, nested, cmd, forceit, group) == FAIL)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user