Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the global bundles instead of reinitializing #242

Merged
merged 1 commit into from
Mar 20, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion autoload/vundle/installer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ endf
func! vundle#installer#install(bang, name) abort
if !isdirectory(g:bundle_dir) | call mkdir(g:bundle_dir, 'p') | endif

let b = vundle#config#init_bundle(a:name, {})
let n = substitute(a:name,"['".'"]\+','','g')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm all for having this merged, in fact, I had done something similar using a dictionary, but this is simpler, although performance-wise, it's still O(n^2) for the whole installation, I don't think it's a big deal, since it's installation after all. Have you tried this with a large number of bundles?

I think, however, and for the sake of sanity, that this would be a great opportunity to replace some of those one letter variable names with other more meaningful ones. That's my suggestion here.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that having more meaningful names here would be better.

Also, I don't know about performance since I haven't tried this out, but I think a couple of seconds wouldn't really matter, IMO. But if it goes over 4+ seconds I think we should probably find another solution. That's just my two cents.

let b = filter(copy(g:bundles), 'v:val.name_spec == n')[0]

return s:sync(a:bang, b)
endf
Expand Down