# HG changeset patch # User Christian Brabandt # Date 1532790906 -7200 # Node ID 9ffce640d0d3c9ae243753723f80850d6aaa164b # Parent 91bc4a6e3a4e33c351de2780e48b89bb7382f3cc patch 8.1.0219: expanding ## fails to escape backtick commit https://github.com/vim/vim/commit/2c8c681bfcd5138a0ec8ce018216dc2dc69a11a0 Author: Bram Moolenaar Date: Sat Jul 28 17:07:52 2018 +0200 patch 8.1.0219: expanding ## fails to escape backtick Problem: Expanding ## fails to escape backtick. Solution: Escape a backtick in a file name. (closes https://github.com/vim/vim/issues/3257) diff --git a/src/ex_docmd.c b/src/ex_docmd.c --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -10954,7 +10954,7 @@ arg_all(void) #ifndef BACKSLASH_IN_FILENAME || *p == '\\' #endif - ) + || *p == '`') { /* insert a backslash */ if (retval != NULL) diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim --- a/src/testdir/test_edit.vim +++ b/src/testdir/test_edit.vim @@ -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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -799,6 +799,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 219, +/**/ 218, /**/ 217,