Check name collissions
This commit is contained in:
parent
53cb1215f6
commit
3c6dd6d16b
@ -7,6 +7,9 @@
|
||||
" ---------------------------------------------------------------------------
|
||||
func! vundle#config#bundle(arg, ...)
|
||||
let bundle = vundle#config#init_bundle(a:arg, a:000)
|
||||
if !s:check_bundle_name(bundle)
|
||||
return
|
||||
endif
|
||||
if exists('g:vundle_lazy_load') && g:vundle_lazy_load
|
||||
call add(g:bundles, bundle)
|
||||
else
|
||||
@ -40,6 +43,7 @@ func! vundle#config#init()
|
||||
if !exists('g:bundles') | let g:bundles = [] | endif
|
||||
call s:rtp_rm_a()
|
||||
let g:bundles = []
|
||||
let g:bundle_names = {}
|
||||
endf
|
||||
|
||||
|
||||
@ -79,6 +83,26 @@ func! vundle#config#init_bundle(name, opts)
|
||||
endf
|
||||
|
||||
|
||||
" ---------------------------------------------------------------------------
|
||||
" Check if the current bundle name has already been used in this running
|
||||
" instance and show an error to that effect.
|
||||
"
|
||||
" bundle -- a bundle object whose name is to be checked
|
||||
" return -- 0 if the bundle's name has been seen before, 1 otherwise
|
||||
" ---------------------------------------------------------------------------
|
||||
funct! s:check_bundle_name(bundle)
|
||||
if has_key(g:bundle_names, a:bundle.name)
|
||||
echoerr 'Vundle error: Name collision for Plugin ' . a:bundle.name_spec .
|
||||
\ '. Plugin ' . g:bundle_names[a:bundle.name] .
|
||||
\ ' previously used the name "' . a:bundle.name . '"' .
|
||||
\ '. Skipping Plugin ' . a:bundle.name_spec . '.'
|
||||
return 0
|
||||
endif
|
||||
let g:bundle_names[a:bundle.name] = a:bundle.name_spec
|
||||
return 1
|
||||
endf
|
||||
|
||||
|
||||
" ---------------------------------------------------------------------------
|
||||
" Parse the options which can be supplied with the bundle specification.
|
||||
" Corresponding documentation: vundle-plugins-configure
|
||||
|
Loading…
Reference in New Issue
Block a user