Problem: Get warning for deleting autocommand group when the autocommand
using the group is scheduled for deletion. (Pavol Juhas)
Solution: Check for deleted autocommand.
event = (event_T)((int)event + 1))
{
for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
- if (ap->group == i)
+ if (ap->group == i && ap->pat != NULL)
{
give_warning((char_u *)_("W19: Deleting augroup that is still in use"), TRUE);
in_use = TRUE;
call assert_equal(1, len(split(execute('au vimBarTest'), "\n")))
endfunc
+func RemoveGroup()
+ autocmd! StartOK
+ augroup! StartOK
+endfunc
+
func Test_augroup_warning()
augroup TheWarning
au VimEnter * echo 'entering'
augroup Another
augroup END
call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
+
+ " no warning for postpone aucmd delete
+ augroup StartOK
+ au VimEnter * call RemoveGroup()
+ augroup END
+ call assert_true(match(execute('au VimEnter'), "StartOK.*VimEnter") >= 0)
+ redir => res
+ doautocmd VimEnter
+ redir END
+ call assert_true(match(res, "W19:") < 0)
endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2300,
/**/
2299,
/**/