Problem: Autocmd not executed when editing a directory ending in a path
separator inside try block.
Solution: Return NOTDONE instead of FAIL. (closes #8885)
filemess(curbuf, fname, (char_u *)_(msg_is_a_directory), 0);
msg_end();
msg_scroll = msg_save;
- return FAIL;
+ return NOTDONE;
}
}
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_SafeState()
CheckRunVimInTerminal
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3453,
/**/
3452,
/**/