Patch 7.4.2300
Problem:    Get warning for deleting autocommand group when the autocommand
            using the group is scheduled for deletion. (Pavol Juhas)
Solution:   Check for deleted autocommand.
Files:      src/fileio.c, src/testdir/test_autocmd.vim


*** ../vim-7.4.2299/src/fileio.c        2016-08-29 22:48:12.133106320 +0200
--- src/fileio.c        2016-09-01 16:11:00.837287399 +0200
***************
*** 8018,8024 ****
                                            event = (event_T)((int)event + 1))
        {
            for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
!               if (ap->group == i)
                {
                    give_warning((char_u *)_("W19: Deleting augroup that is 
still in use"), TRUE);
                    in_use = TRUE;
--- 8018,8024 ----
                                            event = (event_T)((int)event + 1))
        {
            for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
!               if (ap->group == i && ap->pat != NULL)
                {
                    give_warning((char_u *)_("W19: Deleting augroup that is 
still in use"), TRUE);
                    in_use = TRUE;
*** ../vim-7.4.2299/src/testdir/test_autocmd.vim        2016-07-29 
20:50:19.859640367 +0200
--- src/testdir/test_autocmd.vim        2016-09-01 16:10:16.629671696 +0200
***************
*** 152,157 ****
--- 152,162 ----
    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'
***************
*** 167,170 ****
--- 172,185 ----
    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
*** ../vim-7.4.2299/src/version.c       2016-09-01 15:45:48.098420758 +0200
--- src/version.c       2016-09-01 16:13:07.692176664 +0200
***************
*** 765,766 ****
--- 765,768 ----
  {   /* Add new patch number below this line */
+ /**/
+     2300,
  /**/

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

 /// 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