mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-16 07:13:52 -05:00
Short circuit when jumping too far in blame history
References https://github.com/tpope/vim-fugitive/issues/607
This commit is contained in:
@@ -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."\<C-E>"
|
||||
elseif delta < 0
|
||||
execute 'normal! '.(-delta)."\<C-Y>"
|
||||
if exists(':Gblame')
|
||||
execute 'Gblame '.args
|
||||
execute lnum
|
||||
let delta = line('.') - line('w0') - offset
|
||||
if delta > 0
|
||||
execute 'normal! '.delta."\<C-E>"
|
||||
elseif delta < 0
|
||||
execute 'normal! '.(-delta)."\<C-Y>"
|
||||
endif
|
||||
syncbind
|
||||
endif
|
||||
syncbind
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user