diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-09-11 22:39:15 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-09-11 22:42:17 -0400 |
commit | 8a845ab3efd87e3c49e4b756a0e74f8e06303fb1 (patch) | |
tree | ec2db3bd1bba06b6336dcd2b91f8ba061b7995e1 | |
parent | a021b30edef84bb6fbdbf0b9e045148eb1d20396 (diff) | |
download | rneovim-8a845ab3efd87e3c49e4b756a0e74f8e06303fb1.tar.gz rneovim-8a845ab3efd87e3c49e4b756a0e74f8e06303fb1.tar.bz2 rneovim-8a845ab3efd87e3c49e4b756a0e74f8e06303fb1.zip |
vim-patch:8.1.0219: expanding ## fails to escape backtick
Problem: Expanding ## fails to escape backtick.
Solution: Escape a backtick in a file name. (closes vim/vim#3257)
https://github.com/vim/vim/commit/2c8c681bfcd5138a0ec8ce018216dc2dc69a11a0
-rw-r--r-- | src/nvim/ex_docmd.c | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_edit.vim | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 03f1446265..6586d82fae 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -8735,7 +8735,7 @@ static char_u *arg_all(void) #ifndef BACKSLASH_IN_FILENAME || *p == '\\' #endif - ) { + || *p == '`') { // insert a backslash if (retval != NULL) { retval[len] = '\\'; diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index 989adfce8f..b1fce07f39 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -1338,6 +1338,14 @@ func! Test_edit_rightleft() bw! 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 |