mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 06:58:35 +00:00
vim-patch:8.2.3453: autocmd not executed when editing a directory (#17846)
Problem: Autocmd not executed when editing a directory ending in a path
separator inside try block.
Solution: Return NOTDONE instead of FAIL. (closes vim/vim#8885)
40fa12aea3
This commit is contained in:
@@ -361,7 +361,7 @@ int readfile(char_u *fname, char_u *sfname, linenr_T from, linenr_T lines_to_ski
|
||||
filemess(curbuf, fname, (char_u *)_(msg_is_a_directory), 0);
|
||||
msg_end();
|
||||
msg_scroll = msg_save;
|
||||
return FAIL;
|
||||
return NOTDONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2343,6 +2343,19 @@ func Test_throw_in_BufWritePre()
|
||||
au! throwing
|
||||
endfunc
|
||||
|
||||
func Test_autocmd_in_try_block()
|
||||
call mkdir('Xdir')
|
||||
au BufEnter * let g:fname = expand('%')
|
||||
try
|
||||
edit Xdir/
|
||||
endtry
|
||||
call assert_match('Xdir', g:fname)
|
||||
|
||||
unlet g:fname
|
||||
au! BufEnter
|
||||
call delete('Xdir', 'rf')
|
||||
endfunc
|
||||
|
||||
func Test_autocmd_CmdWinEnter()
|
||||
CheckRunVimInTerminal
|
||||
" There is not cmdwin switch, so
|
||||
|
Reference in New Issue
Block a user