parent
eb25f320a0
commit
765a2d21d3
1 changed files with 14 additions and 3 deletions
17
plug.vim
17
plug.vim
|
@ -402,6 +402,17 @@ function! s:doautocmd(...)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:dobufread(names)
|
||||||
|
for name in a:names
|
||||||
|
let path = s:rtp(g:plugs[name]).'/**'
|
||||||
|
for dir in ['ftdetect', 'ftplugin']
|
||||||
|
if len(finddir(dir, path))
|
||||||
|
return s:doautocmd('BufRead')
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! plug#load(...)
|
function! plug#load(...)
|
||||||
if a:0 == 0
|
if a:0 == 0
|
||||||
return s:err('Argument missing: plugin name(s) required')
|
return s:err('Argument missing: plugin name(s) required')
|
||||||
|
@ -417,7 +428,7 @@ 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
|
||||||
call s:doautocmd('BufRead')
|
call s:dobufread(a:000)
|
||||||
return 1
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -467,13 +478,13 @@ endfunction
|
||||||
|
|
||||||
function! s:lod_cmd(cmd, bang, l1, l2, args, names)
|
function! s:lod_cmd(cmd, bang, l1, l2, args, names)
|
||||||
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
||||||
call s:doautocmd('BufRead')
|
call s:dobufread(a:names)
|
||||||
execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
|
execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:lod_map(map, names, prefix)
|
function! s:lod_map(map, names, prefix)
|
||||||
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
|
||||||
call s:doautocmd('BufRead')
|
call s:dobufread(a:names)
|
||||||
let extra = ''
|
let extra = ''
|
||||||
while 1
|
while 1
|
||||||
let c = getchar(0)
|
let c = getchar(0)
|
||||||
|
|
Loading…
Reference in a new issue