mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-19 10:35:38 -07:00
Fix #184 - Avoid duplicate entries in g:plugs_order
This commit is contained in:
parent
c759170ce2
commit
a34b745a21
4
plug.vim
4
plug.vim
@ -427,8 +427,10 @@ function! s:add(repo, ...)
|
||||
let name = fnamemodify(repo, ':t:s?\.git$??')
|
||||
let spec = extend(s:infer_properties(name, repo),
|
||||
\ a:0 == 1 ? s:parse_options(a:1) : s:base_spec)
|
||||
if !has_key(g:plugs, name)
|
||||
call add(g:plugs_order, name)
|
||||
endif
|
||||
let g:plugs[name] = spec
|
||||
let g:plugs_order += [name]
|
||||
let s:loaded[name] = 0
|
||||
catch
|
||||
return s:err(v:exception)
|
||||
|
@ -226,3 +226,17 @@ Execute (#154: Spaces in &rtp should not be escaped):
|
||||
Log &rtp
|
||||
Assert stridx(&rtp, 'plug it/seoul256 vim') >= 0
|
||||
|
||||
**********************************************************************
|
||||
Execute (#184: Duplicate entries in &rtp):
|
||||
call plug#begin('$TMPDIR/plugged')
|
||||
Plug 'plugin1'
|
||||
\| Plug 'plugin0'
|
||||
|
||||
Plug 'plugin2'
|
||||
\| Plug 'plugin0'
|
||||
\| Plug 'plugin1'
|
||||
call plug#end()
|
||||
|
||||
Log &rtp
|
||||
AssertEqual 3, len(uniq(filter(split(&rtp, ','), 'stridx(v:val, "plugged") >= 0')))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user