Skip to content

Commit eee50c5

Browse files
blueyedjanlazo
authored andcommitted
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.
1 parent 96046c0 commit eee50c5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

plug.vim

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,11 @@ function! s:progress_opt(base)
334334
\ s:git_version_requirement(1, 7, 1) ? '--progress' : ''
335335
endfunction
336336

337-
if s:is_win
338-
function! s:rtp(spec)
339-
return s:path(a:spec.dir . get(a:spec, 'rtp', ''))
340-
endfunction
337+
function! s:rtp(spec)
338+
return s:path(a:spec.dir . get(a:spec, 'rtp', ''))
339+
endfunction
341340

341+
if s:is_win
342342
function! s:path(path)
343343
return s:trim(substitute(a:path, '/', '\', 'g'))
344344
endfunction
@@ -376,10 +376,6 @@ if s:is_win
376376
return [batchfile, cmd]
377377
endfunction
378378
else
379-
function! s:rtp(spec)
380-
return s:dirpath(a:spec.dir . get(a:spec, 'rtp', ''))
381-
endfunction
382-
383379
function! s:path(path)
384380
return s:trim(a:path)
385381
endfunction

0 commit comments

Comments
 (0)