diff --git a/.vimrc b/.vimrc index 55ccfde..9aec902 100644 --- a/.vimrc +++ b/.vimrc @@ -1555,11 +1555,9 @@ fu! Search(path, search_args, case_insensitive=0, token="") " Some characters need to be escaped. 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' - let l:cmd = printf(l:format, shellescape(l:escaped_term)) - - exec l:cmd + exec printf("Rg " . l:rg_args . " %s -e %s", shellescape(l:escaped_path), shellescape(l:escaped_term)) call ConvertQuickfixPathsToUnixSlashes() endfu