Refactor global variables into script local variables.
These variables only occur in one file each. By making them script local
variables this is "documented" in the code. At the same time the global
namespace is polluted less.
Changed:
g:bundle_names -> s:bundle_names
g:vundle_last_status -> s:last_status
g:vundle_log_file -> s:log_file
g:vundle_view -> s:view
This commit is contained in:
@@ -43,7 +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 = {}
|
||||
let s:bundle_names = {}
|
||||
endf
|
||||
|
||||
|
||||
@@ -91,14 +91,14 @@ endf
|
||||
" 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)
|
||||
if has_key(s:bundle_names, a:bundle.name)
|
||||
echoerr 'Vundle error: Name collision for Plugin ' . a:bundle.name_spec .
|
||||
\ '. Plugin ' . g:bundle_names[a:bundle.name] .
|
||||
\ '. Plugin ' . s: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
|
||||
let s:bundle_names[a:bundle.name] = a:bundle.name_spec
|
||||
return 1
|
||||
endf
|
||||
|
||||
|
||||
Reference in New Issue
Block a user