Better resolving of relative plugin dirs

Resolve folder names such as 'dir': 'some-repo-before-compat-break' in a Plug spec as relative to the g:plug_home directory, rather than the current working directory.
This commit is contained in:
Roy-Orbison 2021-02-08 11:58:53 +10:30 committed by GitHub
parent 8b45742540
commit 50d0a1a5b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -750,7 +750,9 @@ function! s:parse_options(arg)
endif endif
call extend(opts, a:arg) call extend(opts, a:arg)
if has_key(opts, 'dir') if has_key(opts, 'dir')
let opts.dir = s:dirpath(s:plug_expand(opts.dir)) exe 'cd' fnameescape(g:plug_home)
let opts.dir = s:dirpath(fnamemodify(s:plug_expand(opts.dir), ':p'))
cd -
endif endif
else else
throw 'Invalid argument type (expected: string or dictionary)' throw 'Invalid argument type (expected: string or dictionary)'