mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-24 04:56:33 -07:00
Print progress of post-update hooks using :!
(#38)
This commit is contained in:
parent
706f7e00ea
commit
b6b10ac17e
13
plug.vim
13
plug.vim
@ -459,8 +459,17 @@ function! s:do(pull, todo)
|
|||||||
call append(3, '- Post-update hook for '. name .' ... ')
|
call append(3, '- Post-update hook for '. name .' ... ')
|
||||||
let type = type(spec.do)
|
let type = type(spec.do)
|
||||||
if type == s:TYPE.string
|
if type == s:TYPE.string
|
||||||
call system(spec.do)
|
try
|
||||||
let result = v:shell_error ? ('Exit status: '.v:shell_error) : 'Done!'
|
" FIXME: Escaping is incomplete. We could use shellescape with eval,
|
||||||
|
" but it won't work on Windows.
|
||||||
|
let g:_plug_do = '!'.escape(spec.do, '#!%')
|
||||||
|
nnoremap <Plug>(plug-do) :execute g:_plug_do<cr><cr>
|
||||||
|
execute "normal \<Plug>(plug-do)"
|
||||||
|
finally
|
||||||
|
let result = v:shell_error ? ('Exit status: '.v:shell_error) : 'Done!'
|
||||||
|
unlet g:_plug_do
|
||||||
|
unmap <Plug>(plug-do)
|
||||||
|
endtry
|
||||||
elseif type == s:TYPE.funcref
|
elseif type == s:TYPE.funcref
|
||||||
try
|
try
|
||||||
call spec.do()
|
call spec.do()
|
||||||
|
Loading…
Reference in New Issue
Block a user