Minor refactoring
This commit is contained in:
parent
59748b0680
commit
5698a055c3
6
plug.vim
6
plug.vim
|
@ -1591,7 +1591,7 @@ EOF
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:shellesc(arg)
|
function! s:shellesc(arg)
|
||||||
return '"'.substitute(a:arg, '"', '\\"', 'g').'"'
|
return '"'.escape(a:arg, '"').'"'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:glob_dir(path)
|
function! s:glob_dir(path)
|
||||||
|
@ -1618,7 +1618,7 @@ function! s:format_message(bullet, name, message)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:with_cd(cmd, dir)
|
function! s:with_cd(cmd, dir)
|
||||||
return printf('cd%s "%s" && %s', s:is_win ? ' /d' : '', escape(a:dir, '"'), a:cmd)
|
return printf('cd%s %s && %s', s:is_win ? ' /d' : '', s:shellesc(a:dir), a:cmd)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:system(cmd, ...)
|
function! s:system(cmd, ...)
|
||||||
|
@ -1904,7 +1904,7 @@ function! s:preview_commit()
|
||||||
execute 'pedit' sha
|
execute 'pedit' sha
|
||||||
wincmd P
|
wincmd P
|
||||||
setlocal filetype=git buftype=nofile nobuflisted
|
setlocal filetype=git buftype=nofile nobuflisted
|
||||||
execute 'silent read !cd "'.escape(g:plugs[name].dir, '"').'" && git show' sha
|
execute 'silent read !cd' s:shellesc(g:plugs[name].dir) '&& git show' sha
|
||||||
normal! gg"_dd
|
normal! gg"_dd
|
||||||
wincmd p
|
wincmd p
|
||||||
endfunction
|
endfunction
|
||||||
|
|
Loading…
Reference in New Issue
Block a user