Mercurial > vim
diff src/testdir/test_autocmd.vim @ 10058:65e43481d7de v7.4.2300
commit https://github.com/vim/vim/commit/5c80908ced601be6db7554a147cdb0f98ac8daa1
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 1 16:21:48 2016 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 01 Sep 2016 16:30:08 +0200 |
parents | a98607bb756c |
children | 3e410e6e1986 |
line wrap: on
line diff
--- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -152,6 +152,11 @@ func Test_early_bar() 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,4 +172,14 @@ func Test_augroup_warning() 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