mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +00: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:
@@ -196,6 +196,25 @@ func Test_augroup_deleted()
|
|||||||
au! VimEnter
|
au! VimEnter
|
||||||
endfunc
|
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
|
" Closing a window might cause an endless loop
|
||||||
" E814 for older Vims
|
" E814 for older Vims
|
||||||
function Test_autocmd_bufwipe_in_SessLoadPost()
|
function Test_autocmd_bufwipe_in_SessLoadPost()
|
||||||
|
Reference in New Issue
Block a user