From 82ac9d90755ed50ba24b788032a5dec4441dda4e Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 29 Mar 2016 23:00:59 +0900 Subject: [PATCH] Use on User autocmd if possible http://ftp.vim.org/pub/vim/patches/7.3/7.3.442 --- plug.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plug.vim b/plug.vim index ac33837..e07a8ca 100644 --- a/plug.vim +++ b/plug.vim @@ -386,6 +386,10 @@ function! s:reorg_rtp() endif endfunction +function! s:doautocmd(...) + execute 'doautocmd' ((v:version > 703 || has('patch442')) ? '' : '') join(a:000) +endfunction + function! plug#load(...) if a:0 == 0 return s:err('Argument missing: plugin name(s) required') @@ -440,7 +444,7 @@ function! s:lod(names, types, ...) call s:source(rtp, a:2) endif if exists('#User#'.name) - execute 'doautocmd User' name + call s:doautocmd('User', name) endif endfor endfunction