vim-patch:8.0.1748: CmdlineEnter command uses backslash instead of slash

Problem:    CmdlineEnter command uses backslash instead of slash.
Solution:   Don't treat the character as a file name. (closes vim/vim#2837)
a4baf5b325
This commit is contained in:
Jan Edmund Lazo
2018-12-10 22:41:37 -05:00
parent 2f3a18695e
commit 0930435fc3
2 changed files with 10 additions and 1 deletions

View File

@@ -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

View File

@@ -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.