|
|
@@ -356,7 +356,9 @@ function! plug#load(...)
|
|
|
for name in a:000
|
|
|
call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
|
|
endfor
|
|
|
- doautocmd BufRead
|
|
|
+ if exists('#BufRead')
|
|
|
+ doautocmd BufRead
|
|
|
+ endif
|
|
|
return 1
|
|
|
endfunction
|
|
|
|
|
|
@@ -392,8 +394,12 @@ endfunction
|
|
|
function! s:lod_ft(pat, names)
|
|
|
call s:lod(a:names, ['plugin', 'after/plugin'])
|
|
|
execute 'autocmd! PlugLOD FileType' a:pat
|
|
|
- doautocmd filetypeplugin FileType
|
|
|
- doautocmd filetypeindent FileType
|
|
|
+ if exists('#filetypeplugin#FileType')
|
|
|
+ doautocmd filetypeplugin FileType
|
|
|
+ endif
|
|
|
+ if exists('#filetypeindent#FileType')
|
|
|
+ doautocmd filetypeindent FileType
|
|
|
+ endif
|
|
|
endfunction
|
|
|
|
|
|
function! s:lod_cmd(cmd, bang, l1, l2, args, names)
|