diff options
| author | lonerover <pathfinder1644@yahoo.com> | 2017-01-05 12:06:09 +0800 |
|---|---|---|
| committer | lonerover <pathfinder1644@yahoo.com> | 2017-01-05 13:33:56 +0800 |
| commit | bef645e5e44068f5f225cdeca5667be9f691e1e1 (patch) | |
| tree | 984c544a4ce06bce537d49c639f8b30d40a167bc /src/nvim/testdir | |
| parent | e21aef1e1002581dc653176eb3d7d4f2b06424f8 (diff) | |
| download | rneovim-bef645e5e44068f5f225cdeca5667be9f691e1e1.tar.gz rneovim-bef645e5e44068f5f225cdeca5667be9f691e1e1.tar.bz2 rneovim-bef645e5e44068f5f225cdeca5667be9f691e1e1.zip | |
vim-patch:7.4.2103
Problem: Can't have "augroup END" right after ":au!".
Solution: Check for the bar character before the command argument.
https://github.com/vim/vim/commit/e99e84497b89e5f91df519790802770920ecf4fe
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_autocmd.vim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index 1dceb70cd4..5675697dc4 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -19,6 +19,7 @@ if has('timers') call timer_start(100, 'ExitInsertMode') call feedkeys('a', 'x!') call assert_equal(1, g:triggered) + au! CursorHoldI endfunc func Test_cursorhold_insert_ctrl_x() @@ -29,6 +30,7 @@ if has('timers') " CursorHoldI does not trigger after CTRL-X call feedkeys("a\<C-X>", 'x!') call assert_equal(0, g:triggered) + au! CursorHoldI endfunc endif @@ -58,5 +60,34 @@ function Test_bufunload() bwipeout call assert_equal(["bufunload", "bufdelete", "bufwipeout"], s:li) + au! test_bufunload_group augroup! test_bufunload_group endfunc + +func s:AddAnAutocmd() + augroup vimBarTest + au BufReadCmd * echo 'hello' + augroup END + call assert_equal(3, len(split(execute('au vimBarTest'), "\n"))) +endfunc + +func Test_early_bar() + " test that a bar is recognized before the {event} + call s:AddAnAutocmd() + augroup vimBarTest | au! | augroup END + call assert_equal(1, len(split(execute('au vimBarTest'), "\n"))) + + call s:AddAnAutocmd() + augroup vimBarTest| au!| augroup END + call assert_equal(1, len(split(execute('au vimBarTest'), "\n"))) + + " test that a bar is recognized after the {event} + call s:AddAnAutocmd() + augroup vimBarTest| au!BufReadCmd| augroup END + call assert_equal(1, len(split(execute('au vimBarTest'), "\n"))) + + " test that a bar is recognized after the {group} + call s:AddAnAutocmd() + au! vimBarTest|echo 'hello' + call assert_equal(1, len(split(execute('au vimBarTest'), "\n"))) +endfunc |