mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 22:33:51 -05:00
@@ -1283,7 +1283,7 @@ endfunction
|
||||
|
||||
call s:add_methods('buffer',['compare_age'])
|
||||
|
||||
function! s:Diff(bang,...) abort
|
||||
function! s:Diff(bang,...)
|
||||
let split = a:bang ? 'split' : 'vsplit'
|
||||
if exists(':DiffGitCached')
|
||||
return 'DiffGitCached'
|
||||
@@ -1930,10 +1930,13 @@ function! s:BufReadIndexFile()
|
||||
try
|
||||
let b:fugitive_type = 'blob'
|
||||
let b:git_dir = s:repo().dir()
|
||||
try
|
||||
call s:ReplaceCmd(s:repo().git_command('cat-file','blob',s:buffer().sha1()))
|
||||
finally
|
||||
if &bufhidden ==# ''
|
||||
setlocal bufhidden=delete
|
||||
endif
|
||||
endtry
|
||||
return ''
|
||||
catch /^fugitive: rev-parse/
|
||||
silent exe 'doau BufNewFile '.s:fnameescape(bufname(''))
|
||||
@@ -1998,6 +2001,7 @@ function! s:BufReadObject()
|
||||
silent %delete
|
||||
setlocal endofline
|
||||
|
||||
try
|
||||
if b:fugitive_type == 'tree'
|
||||
let b:fugitive_display_format = b:fugitive_display_format % 2
|
||||
if b:fugitive_display_format
|
||||
@@ -2032,6 +2036,7 @@ function! s:BufReadObject()
|
||||
elseif b:fugitive_type ==# 'blob'
|
||||
call s:ReplaceCmd(s:repo().git_command('cat-file',b:fugitive_type,hash))
|
||||
endif
|
||||
finally
|
||||
call setpos('.',pos)
|
||||
setlocal ro noma nomod
|
||||
if &bufhidden ==# ''
|
||||
@@ -2044,6 +2049,7 @@ function! s:BufReadObject()
|
||||
else
|
||||
call s:JumpInit()
|
||||
endif
|
||||
endtry
|
||||
|
||||
return ''
|
||||
catch /^fugitive:/
|
||||
|
||||
Reference in New Issue
Block a user