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)
2c8c681bfc
This commit is contained in:
Jan Edmund Lazo 2018-09-11 22:39:15 -04:00
parent a021b30ede
commit 8a845ab3ef
2 changed files with 9 additions and 1 deletions

View File

@ -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] = '\\';

View File

@ -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