Minor tweaks

This commit is contained in:
Junegunn Choi 2014-07-31 03:04:59 +09:00
parent 25afdf138c
commit fe7c7e7b40

View File

@ -149,8 +149,7 @@ function! plug#end()
endif endif
if has_key(plug, 'on') if has_key(plug, 'on')
let commands = s:to_a(plug.on) for cmd in s:to_a(plug.on)
for cmd in commands
if cmd =~ '^<Plug>.\+' if cmd =~ '^<Plug>.\+'
if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i')) if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i'))
for [mode, map_prefix, key_prefix] in for [mode, map_prefix, key_prefix] in
@ -311,7 +310,7 @@ function! s:add(repo, ...)
let repo = s:trim(a:repo) let repo = s:trim(a:repo)
let name = fnamemodify(repo, ':t:s?\.git$??') let name = fnamemodify(repo, ':t:s?\.git$??')
let spec = extend(s:infer_properties(name, repo), let spec = extend(s:infer_properties(name, repo),
\ a:0 == 1 ? s:parse_options(a:1) : copy(s:base_spec)) \ a:0 == 1 ? s:parse_options(a:1) : s:base_spec)
let g:plugs[name] = spec let g:plugs[name] = spec
let g:plugs_order += [name] let g:plugs_order += [name]
catch catch
@ -341,7 +340,7 @@ endfunction
function! s:infer_properties(name, repo) function! s:infer_properties(name, repo)
let repo = a:repo let repo = a:repo
if s:is_local_plug(repo) if s:is_local_plug(repo)
let properties = { 'dir': s:dirpath(expand(repo)) } return { 'dir': s:dirpath(expand(repo)) }
else else
if repo =~ ':' if repo =~ ':'
let uri = repo let uri = repo
@ -352,9 +351,8 @@ function! s:infer_properties(name, repo)
let uri = 'https://git:@github.com/' . repo . '.git' let uri = 'https://git:@github.com/' . repo . '.git'
endif endif
let dir = s:dirpath( fnamemodify(join([g:plug_home, a:name], '/'), ':p') ) let dir = s:dirpath( fnamemodify(join([g:plug_home, a:name], '/'), ':p') )
let properties = { 'dir': dir, 'uri': uri } return { 'dir': dir, 'uri': uri }
endif endif
return properties
endfunction endfunction
function! s:install(...) function! s:install(...)