]> granicus.if.org Git - vim/commitdiff
patch 8.0.1748: CmdlineEnter command uses backslash instead of slash v8.0.1748
authorBram Moolenaar <Bram@vim.org>
Sun, 22 Apr 2018 11:27:44 +0000 (13:27 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 22 Apr 2018 11:27:44 +0000 (13:27 +0200)
Problem:    CmdlineEnter command uses backslash instead of slash.
Solution:   Don't treat the character as a file name. (closes #2837)

src/fileio.c
src/testdir/test_autocmd.vim
src/version.c

index f02925bed5db987f099f5531cb352e899b8fb1d6..700bd3ea53de80e74624e771383526f1443fb689 100644 (file)
@@ -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);
     }
index 2d7956f45d1a3a18b18edc0d215dc2c66b63bbe8..1c34e3049bd915ab00b290f5fc30d9b8a5bdd9ee 100644 (file)
@@ -837,6 +837,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
@@ -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.
index a18394a823fed8ac3cf29d0dc24f5c3466514e23..28a053a58e70014df839a97252f6a2cfcdf9525c 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1748,
 /**/
     1747,
 /**/