Fix typo in utility#escape().

This commit is contained in:
Andy Stewart
2014-01-29 16:10:12 +01:00
parent bd2091a850
commit 5ac69a8bbc

View File

@@ -61,14 +61,14 @@ function! utility#file_relative_to_repo_root()
return substitute(s:file, repo_root_for_file, '', '')
endfunction
" https://github.com/tpope/vim-dispatch/blob/9cdd05a87f8a47120335be03dfcd8358544221cd/autoload/dispatch/windows.vim#L8-L17
" https://github.com/tpope/vim-dispatch/blob/bc415acd37187cbd6b417d92af40ba2c4b3b8775/autoload/dispatch/windows.vim#L8-L17
function! utility#escape(str)
if &shellxquote ==# '"'
return '"' . substitute(a:str, '"', '""', 'g') . '"'
else
let esc = exists('+shellxescape') ? &shellxescape : '"&|<>()@^'
return &shellquote .
\ substitute(a:str, '['.esc.']', '&', 'g') .
\ substitute(a:str, '['.esc.']', '^&', 'g') .
\ get({'(': ')', '"(': ')"'}, &shellquote, &shellquote)
endif
endfunction