summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-13 22:01:02 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-13 22:01:02 +0100
commite13b9afe1283f5ae43232b5992372a0eb570666c (patch)
treebd533d936ffe99f5791dc6f2f9284d980a88633d /src/testdir
parent70bcd7336f9f19304f32c52a86ed5b4b3de852c2 (diff)
downloadvim-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')
-rw-r--r--src/testdir/test_autocmd.vim19
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