diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 41645f6..dbbc754 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1500,14 +1500,14 @@ function! s:Diff(bang,...) try let spec = s:repo().translate(file) let commit = matchstr(spec,'\C[^:/]//\zs\x\+') + let restore = s:diff_restore() + let w:fugitive_diff_restore = restore if s:buffer().compare_age(commit) < 0 - execute 'rightbelow '.vert.'split '.s:fnameescape(spec) + execute 'rightbelow '.vert.'diffsplit '.s:fnameescape(spec) else - execute 'leftabove '.vert.'split '.s:fnameescape(spec) + execute 'leftabove '.vert.'diffsplit '.s:fnameescape(spec) endif - call s:diffthis() - wincmd p - call s:diffthis() + let w:fugitive_diff_restore = restore return '' catch /^fugitive:/ return 'echoerr v:errmsg'