11" ---------------------------------------------------------------------------
2- " Try to clone all new bundles given (or all bundles in g:bundles by default)
3- " to g:bundle_dir. If a:bang is 1 it will also update all plugins (git pull).
2+ " Try to clone all new bundles given (or all bundles in g:vundle#bundles by
3+ " default) to g:vundle#bundle_dir. If a:bang is 1 it will also update all
4+ " plugins (git pull).
45"
56" bang -- 1 or 0
67" ... -- any number of bundle specifications (separate arguments)
78" ---------------------------------------------------------------------------
89func ! vundle#installer#new (bang , ... ) abort
910 " No specific plugins are specified. Operate on all plugins.
1011 if a: 0 == 0
11- let bundles = g: bundles
12+ let bundles = g: vundle # bundles
1213 " Specific plugins are specified for update. Update them.
1314 elseif (a: bang )
14- let bundles = filter (copy (g: bundles ), ' index(a:000, v:val.name) > -1' )
15+ let bundles = filter (copy (g: vundle # bundles), ' index(a:000, v:val.name) > -1' )
1516 " Specific plugins are specified for installation. Install them.
1617 else
1718 let bundles = map (copy (a: 000 ), ' vundle#config#bundle(v:val, {})' )
@@ -23,7 +24,7 @@ func! vundle#installer#new(bang, ...) abort
2324 endif
2425
2526 let names = vundle#scripts#bundle_names (map (copy (bundles), ' v:val.name_spec' ))
26- call vundle#scripts#view (' Installer' ,[' " Installing plugins to ' .expand (g: bundle_dir , 1 )], names + [' Helptags' ])
27+ call vundle#scripts#view (' Installer' ,[' " Installing plugins to ' .expand (g: vundle # bundle_dir, 1 )], names + [' Helptags' ])
2728
2829 " This calls 'add' as a normal mode command. This is a buffer local mapping
2930 " defined in vundle#scripts#view(). The mapping will call a buffer local
@@ -55,11 +56,11 @@ func! s:process(bang, cmd)
5556
5657 exec ' :norm ' .a: cmd
5758
58- if ' error' == g: vundle_last_status
59+ if ' error' == s: last_status
5960 let msg = ' With errors; press l to view log'
6061 endif
6162
62- if ' updated' == g: vundle_last_status && empty (msg)
63+ if ' updated' == s: last_status && empty (msg)
6364 let msg = ' Plugins updated; press u to view changelog'
6465 endif
6566
@@ -118,7 +119,7 @@ func! vundle#installer#run(func_name, name, ...) abort
118119 throw ' whoops, unknown status:' .status
119120 endif
120121
121- let g: vundle_last_status = status
122+ let s: last_status = status
122123
123124 return status
124125endf
@@ -163,10 +164,10 @@ endf
163164" return -- the return value from s:sync()
164165" ---------------------------------------------------------------------------
165166func ! vundle#installer#install (bang , name) abort
166- if ! isdirectory (g: bundle_dir ) | call mkdir (g: bundle_dir , ' p' ) | endif
167+ if ! isdirectory (g: vundle # bundle_dir) | call mkdir (g: vundle # bundle_dir, ' p' ) | endif
167168
168169 let n = substitute (a: name ," ['" .' "]\+' ,' ' ,' g' )
169- let matched = filter (copy (g: bundles ), ' v:val.name_spec == n' )
170+ let matched = filter (copy (g: vundle # bundles), ' v:val.name_spec == n' )
170171
171172 if len (matched) > 0
172173 let b = matched[0 ]
@@ -179,12 +180,12 @@ endf
179180
180181
181182" ---------------------------------------------------------------------------
182- " Call :helptags for all bundles in g:bundles.
183+ " Call :helptags for all bundles in g:vundle# bundles.
183184"
184185" return -- 'error' if an error occurred, else return 'helptags'
185186" ---------------------------------------------------------------------------
186187func ! vundle#installer#docs () abort
187- let error_count = vundle#installer#helptags (g: bundles )
188+ let error_count = vundle#installer#helptags (g: vundle # bundles)
188189 if error_count > 0
189190 return ' error'
190191 endif
@@ -222,10 +223,10 @@ endf
222223" bang -- not used
223224" ---------------------------------------------------------------------------
224225func ! vundle#installer#list (bang ) abort
225- let bundles = vundle#scripts#bundle_names (map (copy (g: bundles ), ' v:val.name_spec' ))
226+ let bundles = vundle#scripts#bundle_names (map (copy (g: vundle # bundles), ' v:val.name_spec' ))
226227 call vundle#scripts#view (' list' , [' " My Plugins' ], bundles)
227228 redraw
228- echo len (g: bundles ).' plugins configured'
229+ echo len (g: vundle # bundles).' plugins configured'
229230endf
230231
231232
@@ -237,10 +238,10 @@ endf
237238" should be removed unconditionally
238239" ---------------------------------------------------------------------------
239240func ! vundle#installer#clean (bang ) abort
240- let bundle_dirs = map (copy (g: bundles ), ' v:val.path()' )
241+ let bundle_dirs = map (copy (g: vundle # bundles), ' v:val.path()' )
241242 let all_dirs = (v: version > 702 || (v: version == 702 && has (" patch51" )))
242- \ ? split (globpath (g: bundle_dir , ' *' , 1 ), " \n " )
243- \ : split (globpath (g: bundle_dir , ' *' ), " \n " )
243+ \ ? split (globpath (g: vundle # bundle_dir, ' *' , 1 ), " \n " )
244+ \ : split (globpath (g: vundle # bundle_dir, ' *' ), " \n " )
244245 let x_dirs = filter (all_dirs, ' 0 > index(bundle_dirs, v:val)' )
245246
246247 if empty (x_dirs)
@@ -465,7 +466,7 @@ func! s:sync(bang, bundle) abort
465466 return ' todate'
466467 endif
467468
468- call add (g: updated_bundles , [initial_sha, updated_sha, a: bundle ])
469+ call add (g: vundle # updated_bundles, [initial_sha, updated_sha, a: bundle ])
469470 return ' updated'
470471endf
471472
@@ -527,7 +528,7 @@ func! s:log(str, ...) abort
527528 let lines = split (a: str , ' \n' , 1 )
528529 let time = strftime (fmt)
529530 for line in lines
530- call add (g: vundle_log , ' [' . time .' ] ' . prefix . line )
531+ call add (g: vundle # log , ' [' . time .' ] ' . prefix . line )
531532 endfor
532533 return a: str
533534endf
0 commit comments