/*
* Loop over the events.
*/
- while (*arg && !VIM_ISWHITE(*arg))
+ while (*arg && !ends_excmd(*arg) && !VIM_ISWHITE(*arg))
if (apply_autocmds_group(event_name2nr(arg, &arg),
fname, NULL, TRUE, group, curbuf, NULL))
nothing_done = FALSE;
* Quickly return if there are no autocommands for this event or
* autocommands are blocked.
*/
- if (first_autopat[(int)event] == NULL || autocmd_blocked > 0)
+ if (event == NUM_EVENTS || first_autopat[(int)event] == NULL
+ || autocmd_blocked > 0)
goto BYPASS_AU;
/*
{
if (event == EVENT_COLORSCHEME || event == EVENT_OPTIONSET)
autocmd_fname = NULL;
- else if (fname != NULL && *fname != NUL)
+ else if (fname != NULL && !ends_excmd(*fname))
autocmd_fname = fname;
else if (buf != NULL)
autocmd_fname = buf->b_ffname;