From c8ac43422e4bb5d96d94b8979a0275911c946825 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 29 Jun 2019 19:19:09 -0400 Subject: [PATCH] Adjust viewport position *after* reload References https://github.com/tpope/vim-fugitive/issues/1268 --- autoload/fugitive.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 0b11304..1c877c7 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2278,13 +2278,16 @@ function! s:Do(action, visual) abort if status < 0 execute record.lnum + 1 endif - call s:StageReveal() + let success = 1 catch /^fugitive:/ return 'echoerr v:errmsg' finally if reload execute s:ReloadStatus() endif + if exists('success') + call s:StageReveal() + endif endtry return '' endfunction