Skip to content

Commit

Permalink
patch 8.1.0219: expanding ## fails to escape backtick
Browse files Browse the repository at this point in the history
Problem:    Expanding ## fails to escape backtick.
Solution:   Escape a backtick in a file name. (closes #3257)
  • Loading branch information
brammool committed Jul 28, 2018
1 parent 95e5147 commit 2c8c681
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ex_docmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -10954,7 +10954,7 @@ arg_all(void)
#ifndef BACKSLASH_IN_FILENAME
|| *p == '\\'
#endif
)
|| *p == '`')
{
/* insert a backslash */
if (retval != NULL)
Expand Down
8 changes: 8 additions & 0 deletions src/testdir/test_edit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,14 @@ func Test_edit_complete_very_long_name()
set swapfile&
endfunc

func Test_edit_backtick()
next a\`b c
call assert_equal('a`b', expand('%'))
next
call assert_equal('c', expand('%'))
call assert_equal('a\`b c', expand('##'))
endfunc

func Test_edit_quit()
edit foo.txt
split
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,8 @@ static char *(features[]) =

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

0 comments on commit 2c8c681

Please sign in to comment.