From 073f3a37b9a7c2db488802e0da7b8d84fef2ab84 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 30 Sep 2015 18:49:29 -0400 Subject: [PATCH] Short circuit when jumping too far in blame history References https://github.com/tpope/vim-fugitive/issues/607 --- plugin/fugitive.vim | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 2fe01d9..9bfb8c7 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -2070,15 +2070,17 @@ function! s:BlameJump(suffix) abort if winnr > 0 exe bufnr.'bdelete' endif - execute 'Gblame '.args - execute lnum - let delta = line('.') - line('w0') - offset - if delta > 0 - execute 'normal! '.delta."\" - elseif delta < 0 - execute 'normal! '.(-delta)."\" + if exists(':Gblame') + execute 'Gblame '.args + execute lnum + let delta = line('.') - line('w0') - offset + if delta > 0 + execute 'normal! '.delta."\" + elseif delta < 0 + execute 'normal! '.(-delta)."\" + endif + syncbind endif - syncbind return '' endfunction