File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8017,6 +8017,8 @@ au_del_group(char_u *name)
80178017 i = au_find_group (name );
80188018 if (i == AUGROUP_ERROR ) /* the group doesn't exist */
80198019 EMSG2 (_ ("E367: No such group: \"%s\"" ), name );
8020+ else if (i == current_augroup )
8021+ EMSG (_ ("E936: Cannot delete the current group" ));
80208022 else
80218023 {
80228024 event_T event ;
Original file line number Diff line number Diff line change @@ -182,13 +182,17 @@ func Test_augroup_warning()
182182 doautocmd VimEnter
183183 redir END
184184 call assert_true (match (res , " W19:" ) < 0 )
185+ au ! VimEnter
185186endfunc
186187
187188func Test_augroup_deleted ()
188- " This caused a crash
189+ " This caused a crash before E936 was introduced
189190 augroup x
191+ call assert_fails (' augroup! x' , ' E936:' )
192+ au VimEnter * echo
193+ augroup end
190194 augroup ! x
191- au VimEnter * echo
192- au VimEnter
195+ call assert_true ( match ( execute ( ' au VimEnter' ), " -Deleted-.*VimEnter " ) >= 0 )
196+ au ! VimEnter
193197endfunc
194198
Original file line number Diff line number Diff line change @@ -763,6 +763,8 @@ static char *(features[]) =
763763
764764static int included_patches [] =
765765{ /* Add new patch number below this line */
766+ /**/
767+ 2314 ,
766768/**/
767769 2313 ,
768770/**/
You can’t perform that action at this time.
0 commit comments