# HG changeset patch # User Christian Brabandt # Date 1524396608 -7200 # Node ID 8a3e9d1e8cf9f8fe6b969b5c3aca649e108b73dc # Parent 0d0adce4320ae051c3825bf3c29986a2d17d378e patch 8.0.1748: CmdlineEnter command uses backslash instead of slash commit https://github.com/vim/vim/commit/a4baf5b32519855bb176a7aa0e9397c137ca890a Author: Bram Moolenaar Date: Sun Apr 22 13:27:44 2018 +0200 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 https://github.com/vim/vim/issues/2837) diff --git a/src/fileio.c b/src/fileio.c --- a/src/fileio.c +++ b/src/fileio.c @@ -9524,6 +9524,12 @@ apply_autocmds_group( * ColorScheme, QuickFixCmd* or DirChanged */ if (event == EVENT_FILETYPE || event == EVENT_SYNTAX + || event == EVENT_CMDLINECHANGED + || event == EVENT_CMDLINEENTER + || event == EVENT_CMDLINELEAVE + || event == EVENT_CMDWINENTER + || event == EVENT_CMDWINLEAVE + || event == EVENT_CMDUNDEFINED || event == EVENT_FUNCUNDEFINED || event == EVENT_REMOTEREPLY || event == EVENT_SPELLFILEMISSING @@ -9532,7 +9538,10 @@ apply_autocmds_group( || event == EVENT_OPTIONSET || event == EVENT_QUICKFIXCMDPOST || event == EVENT_DIRCHANGED) + { fname = vim_strsave(fname); + autocmd_fname_full = TRUE; /* don't expand it later */ + } else fname = FullName_save(fname, FALSE); } diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -837,6 +837,8 @@ func Test_Cmdline() au! CmdlineEnter au! CmdlineLeave + let save_shellslash = &shellslash + set noshellslash au! CmdlineEnter / let g:entered = expand('') au! CmdlineLeave / let g:left = expand('') let g:entered = 0 @@ -849,6 +851,7 @@ func Test_Cmdline() bwipe! au! CmdlineEnter au! CmdlineLeave + let &shellslash = save_shellslash endfunc " Test for BufWritePre autocommand that deletes or unloads the buffer. diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1748, +/**/ 1747, /**/ 1746,