Skip to content
forked from neovim/neovim

Commit

Permalink
vim-patch:8.0.0177
Browse files Browse the repository at this point in the history
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 vim/vim#1375,
            closes vim/vim#1353)

vim/vim@e13b9af
  • Loading branch information
justinmk committed Mar 22, 2017
1 parent b9e1289 commit ca853ed
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/nvim/testdir/test_autocmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,25 @@ func Test_augroup_deleted()
au! VimEnter
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

" Closing a window might cause an endless loop
" E814 for older Vims
function Test_autocmd_bufwipe_in_SessLoadPost()
Expand Down

0 comments on commit ca853ed

Please sign in to comment.