Remove unnecessary escaping.

While I can't say I fully understand escaping rules for Windows, I
understand them better now than I did when I copied that code from
another plugin and hoped for the best.

As far as I can tell, this escaping code was written to be used when
manually constructing a system command to execute – which isn't how this
plugin is written.  So this code shouldn't be here.
This commit is contained in:
Andy Stewart
2014-01-31 10:04:41 +01:00
parent f016924284
commit 8541eec8fc
2 changed files with 0 additions and 13 deletions

View File

@@ -23,7 +23,6 @@ function! diff#run_diff(realtime, use_external_grep)
endif
let cmd .= ')'
let cmd = utility#escape(cmd)
if a:realtime
let diff = system(utility#command_in_directory_of_file(cmd), utility#buffer_contents())

View File

@@ -57,18 +57,6 @@ function! utility#file_relative_to_repo_root()
return substitute(s:file, repo_root_for_file, '', '')
endfunction
" 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') .
\ get({'(': ')', '"(': ')"'}, &shellquote, &shellquote)
endif
endfunction
function! utility#command_in_directory_of_file(cmd)
let directory_of_file = shellescape(fnamemodify(utility#file(), ':h'))
return 'cd ' . directory_of_file . ' && ' . a:cmd