4
4
" Readme: http://github.com/gmarik/Vundle.vim/blob/master/README.md
5
5
" Version: 0.10.2
6
6
7
+ " Save the path from which Vundle was first loaded
8
+ let vundle#vundle_path = expand (' <sfile>:p:h:h' )
9
+
7
10
" Plugin Commands
8
11
com ! -nargs =+ - bar Plugin
9
12
\ call vundle#config#bundle (<args> )
@@ -64,6 +67,21 @@ func! vundle#rc(...) abort
64
67
if a: 0 > 0
65
68
let g: vundle #bundle_dir = expand (a: 1 , 1 )
66
69
endif
70
+
71
+ " If this function has already been called and Vim hasn't finished loading,
72
+ " that is, we are not sourcing our .vimrc file later on, Vundle is probably
73
+ " loading from several sources which can lead to unpredictable results.
74
+ if exists (' g:vundle#vundle_loading' ) && g: vundle #vundle_loading
75
+ echoerr ' Vundle is probably loading from several sources. ' .
76
+ \ ' This can lead to unpredictable results! ' .
77
+ \ ' Please find and remove the duplication.'
78
+ endif
79
+
80
+ " Set g:vundle_loading only if Vim hasn't finished loading.
81
+ if ! exists (' g:vundle#vundle_loaded' ) || ! g: vundle #vundle_loaded
82
+ let g: vundle #vundle_loading = 1
83
+ endif
84
+
67
85
call vundle#config#init ()
68
86
endf
69
87
@@ -87,4 +105,12 @@ let vundle#lazy_load = 0
87
105
let vundle#log = []
88
106
let vundle#updated_bundles = []
89
107
108
+ augroup vundle
109
+ au !
110
+
111
+ " Tell Vundle it has finished loading and Vim is up and running.
112
+ au VimEnter * unlet g: vundle #vundle_loading
113
+ au VimEnter * let g: vundle #vundle_loaded = 1
114
+ augroup END
115
+
90
116
" vim: set expandtab sts = 2 ts = 2 sw = 2 tw = 78 norl :
0 commit comments