Fix #114 - &rtp should not contain empty path
This commit is contained in:
parent
bd2cb9d2de
commit
425ef39db2
5
plug.vim
5
plug.vim
|
@ -289,9 +289,10 @@ function! s:reorg_rtp()
|
||||||
let s:middle = get(s:, 'middle', &rtp)
|
let s:middle = get(s:, 'middle', &rtp)
|
||||||
let rtps = map(s:loaded_names(), 's:rtp(g:plugs[v:val])')
|
let rtps = map(s:loaded_names(), 's:rtp(g:plugs[v:val])')
|
||||||
let afters = filter(map(copy(rtps), 'globpath(v:val, "after")'), 'isdirectory(v:val)')
|
let afters = filter(map(copy(rtps), 'globpath(v:val, "after")'), 'isdirectory(v:val)')
|
||||||
let &rtp = join(map(rtps, 's:escrtp(v:val)'), ',')
|
let rtp = join(map(rtps, 's:escrtp(v:val)'), ',')
|
||||||
\ . substitute(','.s:middle.',', '^,,$', ',', '')
|
\ . ','.s:middle.','
|
||||||
\ . join(map(afters, 's:escrtp(v:val)'), ',')
|
\ . join(map(afters, 's:escrtp(v:val)'), ',')
|
||||||
|
let &rtp = substitute(substitute(rtp, ',,*', ',', 'g'), '^,\|,$', '', 'g')
|
||||||
let s:prtp = &rtp
|
let s:prtp = &rtp
|
||||||
|
|
||||||
if !empty(s:first_rtp)
|
if !empty(s:first_rtp)
|
||||||
|
|
|
@ -1089,6 +1089,16 @@ Execute (PlugSnapshot):
|
||||||
AssertEqual 'snapshot.sh', fnamemodify(expand('%'), ':t')
|
AssertEqual 'snapshot.sh', fnamemodify(expand('%'), ':t')
|
||||||
q
|
q
|
||||||
|
|
||||||
|
**********************************************************************
|
||||||
|
Execute (#114 Should not contain empty path in &rtp):
|
||||||
|
call plug#begin('$TMPDIR/plugged')
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
Log &rtp
|
||||||
|
Assert &rtp !~ ',,', 'Commas'
|
||||||
|
Assert &rtp !~ '^,', 'Comma prefix'
|
||||||
|
Assert &rtp !~ ',$', 'Comma suffix'
|
||||||
|
|
||||||
Execute (Cleanup):
|
Execute (Cleanup):
|
||||||
silent! call system('rm -rf '.temp_plugged)
|
silent! call system('rm -rf '.temp_plugged)
|
||||||
silent! call system('rm -rf '.temp_plugged)
|
silent! call system('rm -rf '.temp_plugged)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user