Use fnamemodify instead of split hackery
Simpler and faster
This commit is contained in:
parent
276106d987
commit
a18087610a
4
plug.vim
4
plug.vim
|
@ -360,7 +360,7 @@ function! s:infer_properties(name, repo)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:extract_name(repo)
|
function! s:extract_name(repo)
|
||||||
return substitute(split(a:repo, '[\/]\+')[-1], '\.git$', '', '')
|
return substitute(fnamemodify(a:repo, ':t'), '\.git$', '', '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:is_local_plug(repo)
|
function! s:is_local_plug(repo)
|
||||||
|
@ -614,7 +614,7 @@ endfunction
|
||||||
function! s:find_plugfiles()
|
function! s:find_plugfiles()
|
||||||
let plugfiles = {}
|
let plugfiles = {}
|
||||||
for pf in split(globpath(g:plug_home, '*/'.s:plug_file), '\n')
|
for pf in split(globpath(g:plug_home, '*/'.s:plug_file), '\n')
|
||||||
let plugfiles[split(pf, '[\/]\+')[-2]] = pf
|
let plugfiles[fnamemodify(pf, ':h:t')] = pf
|
||||||
endfor
|
endfor
|
||||||
return plugfiles
|
return plugfiles
|
||||||
endfunction
|
endfunction
|
||||||
|
|
Loading…
Reference in New Issue
Block a user