Check if autocmd defined before doautocmd
This removes `No matching autocommands` message
This commit is contained in:
parent
76bce26ab8
commit
179fa7bb82
12
plug.vim
12
plug.vim
|
@ -356,7 +356,9 @@ function! plug#load(...)
|
||||||
for name in a:000
|
for name in a:000
|
||||||
call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
||||||
endfor
|
endfor
|
||||||
doautocmd BufRead
|
if exists('#BufRead')
|
||||||
|
doautocmd BufRead
|
||||||
|
endif
|
||||||
return 1
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -392,8 +394,12 @@ endfunction
|
||||||
function! s:lod_ft(pat, names)
|
function! s:lod_ft(pat, names)
|
||||||
call s:lod(a:names, ['plugin', 'after/plugin'])
|
call s:lod(a:names, ['plugin', 'after/plugin'])
|
||||||
execute 'autocmd! PlugLOD FileType' a:pat
|
execute 'autocmd! PlugLOD FileType' a:pat
|
||||||
doautocmd filetypeplugin FileType
|
if exists('#filetypeplugin#FileType')
|
||||||
doautocmd filetypeindent FileType
|
doautocmd filetypeplugin FileType
|
||||||
|
endif
|
||||||
|
if exists('#filetypeindent#FileType')
|
||||||
|
doautocmd filetypeindent FileType
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:lod_cmd(cmd, bang, l1, l2, args, names)
|
function! s:lod_cmd(cmd, bang, l1, l2, args, names)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user