Patch 7.4.2314
Problem:    No error when deleting an augroup while it's the current one.
Solution:   Disallow deleting an augroup when it's the current one.
Files:      src/fileio.c, src/testdir/test_autocmd.vim


*** ../vim-7.4.2313/src/fileio.c        2016-09-03 16:43:49.147060493 +0200
--- src/fileio.c        2016-09-03 16:58:56.619118153 +0200
***************
*** 8017,8022 ****
--- 8017,8024 ----
      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;
*** ../vim-7.4.2313/src/testdir/test_autocmd.vim        2016-09-03 
16:43:49.147060493 +0200
--- src/testdir/test_autocmd.vim        2016-09-03 16:51:19.859125261 +0200
***************
*** 182,194 ****
    doautocmd VimEnter
    redir END
    call assert_true(match(res, "W19:") < 0)
  endfunc
  
  func Test_augroup_deleted()
!   " This caused a crash
    augroup x
    augroup! x
!   au VimEnter * echo
!   au VimEnter
  endfunc
  
--- 182,198 ----
    doautocmd VimEnter
    redir END
    call assert_true(match(res, "W19:") < 0)
+   au! VimEnter
  endfunc
  
  func Test_augroup_deleted()
!   " This caused a crash before E936 was introduced
    augroup x
+     call assert_fails('augroup! x', 'E936:')
+     au VimEnter * echo
+   augroup end
    augroup! x
!   call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
!   au! VimEnter
  endfunc
  
*** ../vim-7.4.2313/src/version.c       2016-09-03 16:43:49.147060493 +0200
--- src/version.c       2016-09-03 16:57:59.723638721 +0200
***************
*** 765,766 ****
--- 765,768 ----
  {   /* Add new patch number below this line */
+ /**/
+     2314,
  /**/

-- 
We are the Borg of GNU GPL.  We will assimilate your source code.
Resistance is futile.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui