Browse Source

try to find configured bundle first

- neccessary for Bundle! configured bundles havin custom settings
- fallback to default behav in case not found
events
gmarik 15 years ago
parent
commit
415a44d0f8
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      autoload/vundle/installer.vim

+ 10
- 1
autoload/vundle/installer.vim View File

@ -2,7 +2,7 @@ func! vundle#installer#install(bang, ...) abort
if !isdirectory(g:vundle#bundle_dir) | call mkdir(g:vundle#bundle_dir, 'p') | endif
let bundles = (a:1 == '') ?
\ s:reload_bundles() :
\ map(copy(a:000), 'vundle#config#init_bundle(v:val, {})')
\ [s:find_or_init_by_name(a:1)]
let cwd = getcwd()
let new_bundles = []
@ -35,6 +35,15 @@ func! vundle#installer#install(bang, ...) abort
call s:doautocmd('BundlesInstallPost', 'vundle#bundle')
endf
" TODO: improve this
func! s:find_or_init_by_name(name)
let matches = filter(copy(g:vundle#bundles), 'v:val.name == a:name')
if (!empty(matches))
return matches[0] "assuming only 1 match may happen
endif
return vundle#config#init_bundle(0, a:name, {})
endf
" TODO: verify whether autocommand already exists
" verbose autocmd User BundleInstall*
func! s:doautocmd(event, augroup_name)


Loading…
Cancel
Save