mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
vim-patch:8.0.0177
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)
e13b9afe12
This commit is contained in:
parent
b9e1289819
commit
ca853edb6f
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user