vimrc: escape text search path
This commit is contained in:
parent
e009688aa0
commit
fe531b185f
6
.vimrc
6
.vimrc
|
|
@ -1555,11 +1555,9 @@ fu! Search(path, search_args, case_insensitive=0, token="")
|
||||||
|
|
||||||
" Some characters need to be escaped.
|
" Some characters need to be escaped.
|
||||||
let l:escaped_term = substitute(l:term, '[#%]', '\\\\\\&', 'g')
|
let l:escaped_term = substitute(l:term, '[#%]', '\\\\\\&', 'g')
|
||||||
|
let l:escaped_path = substitute(a:path, '[#%]', '\\\\\\&', 'g')
|
||||||
|
|
||||||
let l:format = 'Rg ' . l:rg_args . ' ' . a:path . ' -e %s'
|
exec printf("Rg " . l:rg_args . " %s -e %s", shellescape(l:escaped_path), shellescape(l:escaped_term))
|
||||||
let l:cmd = printf(l:format, shellescape(l:escaped_term))
|
|
||||||
|
|
||||||
exec l:cmd
|
|
||||||
|
|
||||||
call ConvertQuickfixPathsToUnixSlashes()
|
call ConvertQuickfixPathsToUnixSlashes()
|
||||||
endfu
|
endfu
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user