Also ignore useless use of 'on'

This commit is contained in:
Junegunn Choi 2018-09-11 19:03:59 +09:00
parent 62d3f1ce15
commit 8a957ccd80
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -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