Skip to content

Commit

Permalink
patch 8.0.1748: CmdlineEnter command uses backslash instead of slash
Browse files Browse the repository at this point in the history
Problem:    CmdlineEnter command uses backslash instead of slash.
Solution:   Don't treat the character as a file name. (closes #2837)
  • Loading branch information
brammool committed Apr 22, 2018
1 parent ebe74b7 commit a4baf5b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
Expand Down
3 changes: 3 additions & 0 deletions src/testdir/test_autocmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1748,
/**/
1747,
/**/
Expand Down

0 comments on commit a4baf5b

Please sign in to comment.