diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-01-13 22:01:02 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-01-13 22:01:02 +0100 |
commit | e13b9afe1283f5ae43232b5992372a0eb570666c (patch) | |
tree | bd533d936ffe99f5791dc6f2f9284d980a88633d /src/testdir/test_autocmd.vim | |
parent | 70bcd7336f9f19304f32c52a86ed5b4b3de852c2 (diff) | |
download | vim-e13b9afe1283f5ae43232b5992372a0eb570666c.zip |
patch 8.0.0177: BufEnter autocommand not fired for a directory
Problem: When opening a buffer on a directory and inside a try/catch then
the BufEnter event is not triggered.
Solution: Return NOTDONE from readfile() for a directory and deal with the
three possible return values. (Justin M. Keyes, closes #1375,
closes #1353)
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r-- | src/testdir/test_autocmd.vim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index 6ebfee45e..566a07c6f 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -322,3 +322,22 @@ func Test_three_windows() call delete('Xtestje2') call delete('Xtestje3') endfunc + +func Test_BufEnter() + au! BufEnter + au Bufenter * let val = val . '+' + let g:val = '' + split NewFile + call assert_equal('+', g:val) + bwipe! + call assert_equal('++', g:val) + + " Also get BufEnter when editing a directory + call mkdir('Xdir') + split Xdir + call assert_equal('+++', g:val) + bwipe! + + call delete('Xdir', 'd') + au! BufEnter +endfunc |