mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
commit
1cca5da05f
@ -8654,7 +8654,10 @@ eval_vars (
|
||||
break;
|
||||
|
||||
case SPEC_AFILE: // file name for autocommand
|
||||
if (autocmd_fname != NULL && !path_is_absolute(autocmd_fname)) {
|
||||
if (autocmd_fname != NULL
|
||||
&& !path_is_absolute(autocmd_fname)
|
||||
// For CmdlineEnter and related events, <afile> is not a path! #9348
|
||||
&& !strequal("/", (char *)autocmd_fname)) {
|
||||
// Still need to turn the fname into a full path. It was
|
||||
// postponed to avoid a delay when <afile> is not used.
|
||||
result = (char_u *)FullName_save((char *)autocmd_fname, false);
|
||||
|
@ -6903,7 +6903,13 @@ static bool apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io,
|
||||
} else {
|
||||
sfname = vim_strsave(fname);
|
||||
// Don't try expanding the following events.
|
||||
if (event == EVENT_COLORSCHEME
|
||||
if (event == EVENT_CMDLINECHANGED
|
||||
|| event == EVENT_CMDLINEENTER
|
||||
|| event == EVENT_CMDLINELEAVE
|
||||
|| event == EVENT_CMDWINENTER
|
||||
|| event == EVENT_CMDWINLEAVE
|
||||
|| event == EVENT_CMDUNDEFINED
|
||||
|| event == EVENT_COLORSCHEME
|
||||
|| event == EVENT_COLORSCHEMEPRE
|
||||
|| event == EVENT_DIRCHANGED
|
||||
|| event == EVENT_FILETYPE
|
||||
|
@ -840,6 +840,8 @@ func Test_Cmdline()
|
||||
au! CmdlineEnter
|
||||
au! CmdlineLeave
|
||||
|
||||
let save_shellslash = &shellslash
|
||||
set noshellslash
|
||||
au! CmdlineEnter / let g:entered = expand('<afile>')
|
||||
au! CmdlineLeave / let g:left = expand('<afile>')
|
||||
let g:entered = 0
|
||||
@ -852,6 +854,7 @@ func Test_Cmdline()
|
||||
bwipe!
|
||||
au! CmdlineEnter
|
||||
au! CmdlineLeave
|
||||
let &shellslash = save_shellslash
|
||||
endfunc
|
||||
|
||||
" Test for BufWritePre autocommand that deletes or unloads the buffer.
|
||||
|
Loading…
Reference in New Issue
Block a user