aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorlonerover <pathfinder1644@yahoo.com>2017-01-09 08:41:45 +0800
committerlonerover <pathfinder1644@yahoo.com>2017-01-09 10:58:05 +0800
commit7486e7586d94c85f04e50ac7429acedc80f9da2f (patch)
tree98eed120b9e25c9b6c5ed1244077a4fac4dad5b5 /src/nvim/testdir
parentf5d06c52a24b512fe555a548360a8393e70007a3 (diff)
downloadrneovim-7486e7586d94c85f04e50ac7429acedc80f9da2f.tar.gz
rneovim-7486e7586d94c85f04e50ac7429acedc80f9da2f.tar.bz2
rneovim-7486e7586d94c85f04e50ac7429acedc80f9da2f.zip
vim-patch:7.4.2117
Problem: Deleting an augroup that still has autocmds does not give a warning. The next defined augroup takes its place. Solution: Give a warning and prevent the index being used for another group name. https://github.com/vim/vim/commit/f2c4c391192cab6e923b1a418d4af09106fba25f
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_autocmd.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index b9d5cfe27b..d856d3296a 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -151,3 +151,20 @@ func Test_early_bar()
au! vimBarTest|echo 'hello'
call assert_equal(1, len(split(execute('au vimBarTest'), "\n")))
endfunc
+
+func Test_augroup_warning()
+ augroup TheWarning
+ au VimEnter * echo 'entering'
+ augroup END
+ call assert_true(match(execute('au VimEnter'), "TheWarning.*VimEnter") >= 0)
+ redir => res
+ augroup! TheWarning
+ redir END
+ call assert_true(match(res, "W19:") >= 0)
+ call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
+
+ " check "Another" does not take the pace of the deleted entry
+ augroup Another
+ augroup END
+ call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
+endfunc