Support plugin pinning
New supported option called 'pinned' for the Plugin command. When set to 1, the plugin is added to rtp but no install/upgrade operation is performed. It not only allows vundle to do rtp management of plugins on VCS other than git, it also allows leaving plugins that had previously been managed by vundle in the current state, with no further updates. Fixes #24, #397
This commit is contained in:
@@ -134,3 +134,7 @@ func! s:bundle.path()
|
||||
return s:expand_path(g:bundle_dir.'/'.self.name)
|
||||
endf
|
||||
|
||||
func! s:bundle.is_pinned()
|
||||
return get(self, 'pinned')
|
||||
endf
|
||||
|
||||
|
||||
@@ -67,6 +67,8 @@ func! vundle#installer#run(func_name, name, ...) abort
|
||||
echo n.' deleted'
|
||||
elseif 'helptags' == status
|
||||
echo n.' regenerated'
|
||||
elseif 'pinned' == status
|
||||
echo n.' pinned'
|
||||
elseif 'error' == status
|
||||
echohl Error
|
||||
echo 'Error processing '.n
|
||||
@@ -219,6 +221,11 @@ func! s:helptags(rtp) abort
|
||||
endf
|
||||
|
||||
func! s:sync(bang, bundle) abort
|
||||
" Do not sync if this bundle is pinned
|
||||
if a:bundle.is_pinned()
|
||||
return 'pinned'
|
||||
endif
|
||||
|
||||
let git_dir = expand(a:bundle.path().'/.git/', 1)
|
||||
if isdirectory(git_dir) || filereadable(expand(a:bundle.path().'/.git', 1))
|
||||
if !(a:bang) | return 'todate' | endif
|
||||
|
||||
Reference in New Issue
Block a user