0
0
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:
Bram Moolenaar
2021-01-28 13:47:59 +01:00
parent d697ddea14
commit 9a046fd08b
6 changed files with 23 additions and 27 deletions

View File

@@ -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
{