From 9bb2da53a0a62a7e85424dc7cf815eab98861224 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 29 Jul 2014 19:08:21 +0900 Subject: [PATCH] Replace s:extract_name with a single fnamemodify call --- plug.vim | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plug.vim b/plug.vim index 9f9b8f2..5b4fae3 100644 --- a/plug.vim +++ b/plug.vim @@ -313,7 +313,7 @@ function! s:add(force, repo, ...) try let repo = s:trim(a:repo) - let name = s:extract_name(repo) + let name = fnamemodify(repo, ':t:s?\.git$??') if !a:force && has_key(g:plugs, name) let s:extended[name] = g:plugs[name] return @@ -367,10 +367,6 @@ function! s:infer_properties(name, repo) return properties endfunction -function! s:extract_name(repo) - return substitute(fnamemodify(a:repo, ':t'), '\.git$', '', '') -endfunction - function! s:install(...) call s:update_impl(0, a:000) endfunction