Use shellescape instead of manual escaping

Close #328
This commit is contained in:
Junegunn Choi 2017-03-07 23:17:04 +09:00
parent 87a910a127
commit e4f79f6e98
No known key found for this signature in database
GPG key ID: 254BC280FEF9C627

View file

@ -110,10 +110,6 @@ function! s:escape(path)
return escape(a:path, ' $%#''"\')
endfunction
function! s:q1(str)
return "'".substitute(a:str, "'", "'\\\\''", 'g')."'"
endfunction
if v:version >= 704
function! s:function(name)
return function(a:name)
@ -613,7 +609,7 @@ function! fzf#vim#ag(query, ...)
let query = empty(a:query) ? '^(?=.)' : a:query
let args = copy(a:000)
let ag_opts = len(args) > 1 && type(args[0]) == s:TYPE.string ? remove(args, 0) : ''
let command = ag_opts . ' ' . s:q1(query)
let command = ag_opts . ' ' . shellescape(query)
return call('fzf#vim#ag_raw', insert(args, command, 0))
endfunction
@ -695,7 +691,7 @@ function! s:btags_sink(lines)
endfunction
function! s:q(query)
return ' --query '.s:q1(a:query)
return ' --query '.shellescape(a:query)
endfunction
" query, [[tag commands], options]