motiejus/dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.jakstys.lt/motiejus/dotfiles.git
Log | Tree | Refs | README | LICENSE

commit cb49f8b4be64dbad09c2f836374e25d92e9ec6f5 (tree)
parent 6aa3f09eb7e08afb39ecd69e91ca22539ec8b044
Author: Tim Pope <code@tpope.net>
Date:   Sat, 21 Jul 2018 21:51:44 -0400

Drop repo.dirglob

Diffstat:
Mautoload/fugitive.vim | 15+++++----------
1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim @@ -386,13 +386,6 @@ endfunction call s:add_methods('repo',['git_command','git_chomp','git_chomp_in_tree','rev_parse']) -function! s:repo_dirglob(base) dict abort - let base = s:sub(a:base,'^/','') - let matches = split(glob(self.tree(s:gsub(base,'/','*&').'*/')),"\n") - call map(matches,'v:val[ strlen(self.tree())+(a:base !~ "^/") : -1 ]') - return matches -endfunction - function! s:repo_superglob(base) dict abort if a:base =~# '^/' || a:base !~# ':' let results = [] @@ -436,7 +429,7 @@ function! s:repo_superglob(base) dict abort endif endfunction -call s:add_methods('repo',['dirglob','superglob']) +call s:add_methods('repo',['superglob']) function! s:repo_config(name) dict abort return fugitive#Config(a:name, self.git_dir) @@ -874,8 +867,10 @@ endfunction " Section: Gcd, Glcd -function! s:DirComplete(A,L,P) abort - let matches = s:repo().dirglob(a:A) +function! s:DirComplete(A, L, P) abort + let base = s:sub(a:A,'^/','') + let matches = split(glob(s:repo().tree(s:gsub(base,'/','*&').'*/')),"\n") + call map(matches,'v:val[ strlen(s:repo().tree())+(a:A !~ "^/") : -1 ]') return matches endfunction