Also ignore useless use of 'on'
This commit is contained in:
parent
62d3f1ce15
commit
8a957ccd80
11
plug.vim
11
plug.vim
|
@ -193,9 +193,12 @@ function! s:ask_no_interrupt(...)
|
||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:has_for(plug)
|
function! s:lazy(plug, opt)
|
||||||
return has_key(a:plug, 'for') &&
|
return has_key(a:plug, a:opt) &&
|
||||||
\ (empty(s:to_a(a:plug.for)) || !isdirectory(a:plug.dir) || len(s:glob(s:rtp(a:plug), 'plugin')))
|
\ (empty(s:to_a(a:plug[a:opt])) ||
|
||||||
|
\ !isdirectory(a:plug.dir) ||
|
||||||
|
\ len(s:glob(s:rtp(a:plug), 'plugin')) ||
|
||||||
|
\ len(s:glob(s:rtp(a:plug), 'after/plugin')))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! plug#end()
|
function! plug#end()
|
||||||
|
@ -219,7 +222,7 @@ function! plug#end()
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
let plug = g:plugs[name]
|
let plug = g:plugs[name]
|
||||||
if get(s:loaded, name, 0) || !has_key(plug, 'on') && !s:has_for(plug)
|
if get(s:loaded, name, 0) || !s:lazy(plug, 'on') && !s:lazy(plug, 'for')
|
||||||
let s:loaded[name] = 1
|
let s:loaded[name] = 1
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user