From c21736dde74300fa81eda011d37eaa060a2df4e9 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 13 Aug 2019 20:31:16 -0400 Subject: [PATCH] Jump to file not diff for boundary commit in :Gblame --- autoload/fugitive.vim | 19 +++++++++++++++---- doc/fugitive.txt | 12 +++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 6172a9f..a33b414 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -4596,7 +4596,7 @@ function! s:BlameCommitFileLnum(...) abort if commit =~# '^0\+$' let commit = '' elseif line !~# '^\^' && has_key(state, 'blame_reverse_end') - let commit = get(s:LinesError('rev-list', '--ancestry-path', '--reverse', commit . '..' . state.blame_reverse_end)[0], 0, commit) + let commit = get(s:LinesError('rev-list', '--ancestry-path', '--reverse', commit . '..' . state.blame_reverse_end)[0], 0, '') endif let lnum = +matchstr(line, ' \zs\d\+\ze \%((\| *\d\+)\)') let path = matchstr(line, '^\^\=\x* \+\%(\d\+ \+\d\+ \+\)\=\zs.\{-\}\ze\s\+\%(\%( \d\+ \)\@ close blame, then open commit - o open commit in horizontal split - O open commit in new tab - p open commit in preview window + gq close blame, then |:Gedit| to return to work + tree version + close blame, and jump to patch that added line + (or directly to blob for boundary commit) + o jump to patch or blob in horizontal split + O jump to patch or blob in new tab + p jump to patch or blob in preview window - reblame at commit ~ reblame at [count]th first grandparent P reblame at [count]th parent (like HEAD^[count])