mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-19 18:47:29 -07:00
Print warning message when plug window is closed
This commit is contained in:
parent
6454158846
commit
c0a83826f9
12
plug.vim
12
plug.vim
@ -810,6 +810,10 @@ function! s:do(pull, force, todo)
|
|||||||
if spec.do[0] == ':'
|
if spec.do[0] == ':'
|
||||||
call s:load_plugin(spec)
|
call s:load_plugin(spec)
|
||||||
execute spec.do[1:]
|
execute spec.do[1:]
|
||||||
|
if !s:plug_window_exists()
|
||||||
|
cd -
|
||||||
|
throw 'Warning: vim-plug was terminated by the post-update hook of '.name
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
let error = s:bang(spec.do)
|
let error = s:bang(spec.do)
|
||||||
endif
|
endif
|
||||||
@ -1059,7 +1063,13 @@ function! s:update_finish()
|
|||||||
redraw
|
redraw
|
||||||
endfor
|
endfor
|
||||||
silent 4 d _
|
silent 4 d _
|
||||||
call s:do(s:update.pull, s:update.force, filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && has_key(v:val, "do")'))
|
try
|
||||||
|
call s:do(s:update.pull, s:update.force, filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && has_key(v:val, "do")'))
|
||||||
|
catch
|
||||||
|
call s:warn('echom', v:exception)
|
||||||
|
call s:warn('echo', '')
|
||||||
|
return
|
||||||
|
endtry
|
||||||
call s:finish(s:update.pull)
|
call s:finish(s:update.pull)
|
||||||
call setline(1, 'Updated. Elapsed time: ' . split(reltimestr(reltime(s:update.start)))[0] . ' sec.')
|
call setline(1, 'Updated. Elapsed time: ' . split(reltimestr(reltime(s:update.start)))[0] . ' sec.')
|
||||||
call s:switch_out('normal! gg')
|
call s:switch_out('normal! gg')
|
||||||
|
@ -959,6 +959,17 @@ Execute (Vim command with : prefix):
|
|||||||
AssertEqual '12345', getline(2)
|
AssertEqual '12345', getline(2)
|
||||||
q
|
q
|
||||||
|
|
||||||
|
Execute (Vim command with : prefix closing the window):
|
||||||
|
call plug#begin()
|
||||||
|
Plug 'junegunn/vim-pseudocl', { 'do': ':close' }
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
redir => out
|
||||||
|
PlugInstall!
|
||||||
|
redir END
|
||||||
|
Assert out =~ 'vim-plug was terminated'
|
||||||
|
Assert out =~ 'of vim-pseudocl'
|
||||||
|
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
~ Overriding `dir`
|
~ Overriding `dir`
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user