mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 19:43:47 -05:00
Fix typo in utility#escape().
This commit is contained in:
@@ -61,14 +61,14 @@ function! utility#file_relative_to_repo_root()
|
|||||||
return substitute(s:file, repo_root_for_file, '', '')
|
return substitute(s:file, repo_root_for_file, '', '')
|
||||||
endfunction
|
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)
|
function! utility#escape(str)
|
||||||
if &shellxquote ==# '"'
|
if &shellxquote ==# '"'
|
||||||
return '"' . substitute(a:str, '"', '""', 'g') . '"'
|
return '"' . substitute(a:str, '"', '""', 'g') . '"'
|
||||||
else
|
else
|
||||||
let esc = exists('+shellxescape') ? &shellxescape : '"&|<>()@^'
|
let esc = exists('+shellxescape') ? &shellxescape : '"&|<>()@^'
|
||||||
return &shellquote .
|
return &shellquote .
|
||||||
\ substitute(a:str, '['.esc.']', '&', 'g') .
|
\ substitute(a:str, '['.esc.']', '^&', 'g') .
|
||||||
\ get({'(': ')', '"(': ')"'}, &shellquote, &shellquote)
|
\ get({'(': ')', '"(': ')"'}, &shellquote, &shellquote)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user