mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-10 04:23:46 -05:00
Fix reverse blame jump for the boundary edge case
When the line is reverse-blamed to an *immediate* child of the current commit it is shown as `^commit` in the reverse blame output. In this case we still need to open the child of this commit since it will be a commit removing the line. Closes https://github.com/tpope/vim-fugitive/issues/1359
This commit is contained in:
committed by
Tim Pope
parent
c9cf1b3cb2
commit
80aa8a9aea
@@ -4712,7 +4712,7 @@ function! s:BlameCommitFileLnum(...) abort
|
|||||||
let commit = matchstr(line, '^\^\=\zs\x\+')
|
let commit = matchstr(line, '^\^\=\zs\x\+')
|
||||||
if commit =~# '^0\+$'
|
if commit =~# '^0\+$'
|
||||||
let commit = ''
|
let commit = ''
|
||||||
elseif line !~# '^\^' && has_key(state, 'blame_reverse_end')
|
elseif has_key(state, 'blame_reverse_end')
|
||||||
let commit = get(s:LinesError('rev-list', '--ancestry-path', '--reverse', commit . '..' . state.blame_reverse_end)[0], 0, '')
|
let commit = get(s:LinesError('rev-list', '--ancestry-path', '--reverse', commit . '..' . state.blame_reverse_end)[0], 0, '')
|
||||||
endif
|
endif
|
||||||
let lnum = +matchstr(line, ' \zs\d\+\ze \%((\| *\d\+)\)')
|
let lnum = +matchstr(line, ' \zs\d\+\ze \%((\| *\d\+)\)')
|
||||||
|
|||||||
Reference in New Issue
Block a user