Skip to content

Commit 2c8c681

Browse files
committed
patch 8.1.0219: expanding ## fails to escape backtick
Problem: Expanding ## fails to escape backtick. Solution: Escape a backtick in a file name. (closes #3257)
1 parent 95e5147 commit 2c8c681

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/ex_docmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10954,7 +10954,7 @@ arg_all(void)
1095410954
#ifndef BACKSLASH_IN_FILENAME
1095510955
|| *p == '\\'
1095610956
#endif
10957-
)
10957+
|| *p == '`')
1095810958
{
1095910959
/* insert a backslash */
1096010960
if (retval != NULL)

src/testdir/test_edit.vim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,14 @@ func Test_edit_complete_very_long_name()
13751375
set swapfile&
13761376
endfunc
13771377

1378+
func Test_edit_backtick()
1379+
next a\`b c
1380+
call assert_equal('a`b', expand('%'))
1381+
next
1382+
call assert_equal('c', expand('%'))
1383+
call assert_equal('a\`b c', expand('##'))
1384+
endfunc
1385+
13781386
func Test_edit_quit()
13791387
edit foo.txt
13801388
split

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,8 @@ static char *(features[]) =
798798

799799
static int included_patches[] =
800800
{ /* Add new patch number below this line */
801+
/**/
802+
219,
801803
/**/
802804
218,
803805
/**/

0 commit comments

Comments
 (0)