Problem: No error when deleting an augroup while it's the current one.
Solution: Disallow deleting an augroup when it's the current one.
i = au_find_group(name);
if (i == AUGROUP_ERROR) /* the group doesn't exist */
EMSG2(_("E367: No such group: \"%s\""), name);
+ else if (i == current_augroup)
+ EMSG(_("E936: Cannot delete the current group"));
else
{
event_T event;
doautocmd VimEnter
redir END
call assert_true(match(res, "W19:") < 0)
+ au! VimEnter
endfunc
func Test_augroup_deleted()
- " This caused a crash
+ " This caused a crash before E936 was introduced
augroup x
+ call assert_fails('augroup! x', 'E936:')
+ au VimEnter * echo
+ augroup end
augroup! x
- au VimEnter * echo
- au VimEnter
+ call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
+ au! VimEnter
endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2314,
/**/
2313,
/**/