Rename blob() to relative()

On second thought, we should exclude .git/ files from blob, so pick a
different name for now.
This commit is contained in:
Tim Pope 2018-06-25 16:43:00 -04:00
parent 70a36ceef8
commit 38c69cfebc

View File

@ -538,7 +538,7 @@ function! s:cpath(path) abort
endif endif
endfunction endfunction
function! s:buffer_blob(...) dict abort function! s:buffer_relative(...) dict abort
let rev = matchstr(self.spec(),'^fugitive:\%(//\)\=.\{-\}\%(//\|::\)\zs.*') let rev = matchstr(self.spec(),'^fugitive:\%(//\)\=.\{-\}\%(//\|::\)\zs.*')
if rev != '' if rev != ''
let rev = s:sub(rev,'\w*','') let rev = s:sub(rev,'\w*','')
@ -630,8 +630,8 @@ function! s:buffer_up(...) dict abort
return rev return rev
endfunction endfunction
call s:add_methods('buffer',['getvar','setvar','getline','repo','type','spec','name','commit','blob','rev','sha1','expand','containing_commit','up']) call s:add_methods('buffer',['getvar','setvar','getline','repo','type','spec','name','commit','relative','rev','sha1','expand','containing_commit','up'])
let s:buffer_prototype.path = s:function('s:buffer_blob') let s:buffer_prototype.path = s:function('s:buffer_relative')
" Section: Git " Section: Git