From 546a6bf2197529ed1bd402244cbf6e72ed62b2ca Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 30 Dec 2013 10:45:54 -0500 Subject: [PATCH] Focus diff window on :Gdiff References #36. --- plugin/fugitive.vim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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'