mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-23 20:45:31 -07:00
Use s:path with s:rtp always (#694)
Having a trailing slash with &rtp entries is problematic when removing them later: if loading on demand is used, s:reorg_rtp might fail to remove the previous runtime paths. Test case has been using maktaba (which triggers unsetting s:middle in s:reorg_rtp), but because of the trailing slashes being used, the previous rtp entries were not removed.
This commit is contained in:
parent
96046c01c3
commit
eee50c55bf
12
plug.vim
12
plug.vim
@ -334,11 +334,11 @@ function! s:progress_opt(base)
|
|||||||
\ s:git_version_requirement(1, 7, 1) ? '--progress' : ''
|
\ s:git_version_requirement(1, 7, 1) ? '--progress' : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if s:is_win
|
function! s:rtp(spec)
|
||||||
function! s:rtp(spec)
|
return s:path(a:spec.dir . get(a:spec, 'rtp', ''))
|
||||||
return s:path(a:spec.dir . get(a:spec, 'rtp', ''))
|
endfunction
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
if s:is_win
|
||||||
function! s:path(path)
|
function! s:path(path)
|
||||||
return s:trim(substitute(a:path, '/', '\', 'g'))
|
return s:trim(substitute(a:path, '/', '\', 'g'))
|
||||||
endfunction
|
endfunction
|
||||||
@ -376,10 +376,6 @@ if s:is_win
|
|||||||
return [batchfile, cmd]
|
return [batchfile, cmd]
|
||||||
endfunction
|
endfunction
|
||||||
else
|
else
|
||||||
function! s:rtp(spec)
|
|
||||||
return s:dirpath(a:spec.dir . get(a:spec, 'rtp', ''))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:path(path)
|
function! s:path(path)
|
||||||
return s:trim(a:path)
|
return s:trim(a:path)
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
Reference in New Issue
Block a user