mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 09:48:19 +00:00
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:
@@ -8735,7 +8735,7 @@ static char_u *arg_all(void)
|
|||||||
#ifndef BACKSLASH_IN_FILENAME
|
#ifndef BACKSLASH_IN_FILENAME
|
||||||
|| *p == '\\'
|
|| *p == '\\'
|
||||||
#endif
|
#endif
|
||||||
) {
|
|| *p == '`') {
|
||||||
// insert a backslash
|
// insert a backslash
|
||||||
if (retval != NULL) {
|
if (retval != NULL) {
|
||||||
retval[len] = '\\';
|
retval[len] = '\\';
|
||||||
|
@@ -1338,6 +1338,14 @@ func! Test_edit_rightleft()
|
|||||||
bw!
|
bw!
|
||||||
endfunc
|
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()
|
func Test_edit_quit()
|
||||||
edit foo.txt
|
edit foo.txt
|
||||||
split
|
split
|
||||||
|
Reference in New Issue
Block a user