Skip to content

Commit 16237bb

Browse files
committed
Set default values for autoload variables.
The setting of the default values for the autoload variables is moved out of any function. One reason being that these settings do not depend on the argument of the function. The second being that Vim will source the autoload script if an undefined autoload variable is referenced and the file is expected to define the variable (see :help autoload).
1 parent 356f245 commit 16237bb

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

autoload/vundle.vim

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ endif
6161
" :Plugin command in the vimrc. It is not possible to do this automatically
6262
" because when loading the vimrc file no plugins where loaded yet.
6363
func! vundle#rc(...) abort
64-
let g:vundle#bundle_dir = len(a:000) > 0 ? expand(a:1, 1) : expand('$HOME/.vim/bundle', 1)
65-
let g:vundle#updated_bundles = []
66-
let g:vundle#log = []
64+
if a:0 > 0
65+
let g:vundle#bundle_dir = expand(a:1, 1)
66+
endif
6767
call vundle#config#init()
6868
endf
6969

@@ -80,4 +80,11 @@ func! vundle#end(...) abort
8080
call vundle#config#activate_bundles()
8181
endf
8282

83+
" Initialize some global variables used by Vundle.
84+
let vundle#bundle_dir = expand('$HOME/.vim/bundle', 1)
85+
let vundle#bundles = []
86+
let vundle#lazy_load = 0
87+
let vundle#log = []
88+
let vundle#updated_bundles = []
89+
8390
" vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl:

0 commit comments

Comments
 (0)