Don't make assumptions about current line number when displaying commit

This commit is contained in:
Tim Pope
2020-01-26 17:39:32 -05:00
parent fc0199555e
commit 268a9c1b8f

View File

@@ -2096,6 +2096,7 @@ function! fugitive#BufReadCmd(...) abort
call s:ReplaceCmd([dir, 'cat-file', b:fugitive_type, rev]) call s:ReplaceCmd([dir, 'cat-file', b:fugitive_type, rev])
else else
call s:ReplaceCmd([dir, 'show', '--no-color', '-m', '--first-parent', '--pretty=format:tree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev]) call s:ReplaceCmd([dir, 'show', '--no-color', '-m', '--first-parent', '--pretty=format:tree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev])
keepjumps 1
keepjumps call search('^parent ') keepjumps call search('^parent ')
if getline('.') ==# 'parent ' if getline('.') ==# 'parent '
silent keepjumps delete_ silent keepjumps delete_