From eee50c55bf691bf6bf04c981c1d1cfed3ffc4588 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 21 Oct 2019 03:52:29 +0200 Subject: [PATCH] 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. --- plug.vim | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plug.vim b/plug.vim index 5c9bd34..ab0e082 100644 --- a/plug.vim +++ b/plug.vim @@ -334,11 +334,11 @@ function! s:progress_opt(base) \ s:git_version_requirement(1, 7, 1) ? '--progress' : '' endfunction -if s:is_win - function! s:rtp(spec) - return s:path(a:spec.dir . get(a:spec, 'rtp', '')) - endfunction +function! s:rtp(spec) + return s:path(a:spec.dir . get(a:spec, 'rtp', '')) +endfunction +if s:is_win function! s:path(path) return s:trim(substitute(a:path, '/', '\', 'g')) endfunction @@ -376,10 +376,6 @@ if s:is_win return [batchfile, cmd] endfunction else - function! s:rtp(spec) - return s:dirpath(a:spec.dir . get(a:spec, 'rtp', '')) - endfunction - function! s:path(path) return s:trim(a:path) endfunction