Skip to content

Commit

Permalink
#38 fix shellescape (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
eugen0329 committed Jul 5, 2018
1 parent dd6b519 commit 0195d3f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
5 changes: 1 addition & 4 deletions autoload/esearch/backend/nvim.vim
Expand Up @@ -103,10 +103,7 @@ endfu
" g:esearch.expand_special has no affect due to josbstart is a function
" (e.g #dispatch uses cmdline, where #,%,... can be expanded)
fu! esearch#backend#nvim#escape_cmd(cmd) abort
let cmd = escape(esearch#util#shellescape(a:cmd), '()')
let cmd = substitute(cmd, '>', '\\>', 'g')
let cmd = substitute(cmd, '&', '\\&', 'g')
return cmd
return shellescape(a:cmd)
endfu

fu! esearch#backend#nvim#init_events() abort
Expand Down
2 changes: 1 addition & 1 deletion autoload/esearch/backend/system.vim
Expand Up @@ -16,7 +16,7 @@ fu! esearch#backend#system#run(request) abort
endfu

fu! esearch#backend#system#escape_cmd(cmd) abort
return escape(esearch#util#shellescape(a:cmd), '()')
return shellescape(a:cmd)
endfu

fu! esearch#backend#system#abort(...) abort
Expand Down
5 changes: 1 addition & 4 deletions autoload/esearch/backend/vim8.vim
Expand Up @@ -93,10 +93,7 @@ endfu
" g:esearch.expand_special has no affect due to josbstart is a function
" (e.g #dispatch uses cmdline, where #,%,... can be expanded)
fu! esearch#backend#vim8#escape_cmd(cmd) abort
let cmd = escape(esearch#util#shellescape(a:cmd), '()')
let cmd = substitute(cmd, '>', '\\>', 'g')
let cmd = substitute(cmd, '&', '\\&', 'g')
return cmd
return shellescape(a:cmd)
endfu

fu! esearch#backend#vim8#init_events() abort
Expand Down
9 changes: 7 additions & 2 deletions autoload/esearch/backend/vimproc.vim
Expand Up @@ -131,9 +131,14 @@ fu! s:completed(request) abort
endfu

fu! esearch#backend#vimproc#abort(bufnr) abort
let esearch = getbufvar(a:bufnr, 'esearch', 0)
" FIXME unify with out#qflist
let esearch = getbufvar(a:bufnr, 'esearch', get(g:, 'esearch_qf', {}))
if empty(esearch)
return -1
endif

let esearch.request.aborted = 1
return empty(esearch) ? 0 : esearch.request.pipe.kill(g:vimproc#SIGTERM)
return esearch.request.pipe.kill(g:vimproc#SIGKILL)
endfu

fu! esearch#backend#vimproc#init_events() abort
Expand Down

0 comments on commit 0195d3f

Please sign in to comment.