From cabcbc263acbb23ab46e5764d39637f6d37ef243 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 31 Aug 2021 12:09:54 -0400 Subject: [PATCH] Further tweak to direct :Git blame count handling I want to reclaim :0,1Git blame for :split, since we can use that even with -addr=other, so go ahead and add 0,6 as our backwards compatible way to force :edit. --- autoload/fugitive.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index e2e41e8..44b66da 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -6625,7 +6625,7 @@ function! s:BlameSubcommand(line1, count, range, bang, mods, options) abort endif return s:BlameCommit(s:Mods(a:mods) . edit, get(readfile(temp), 0, ''), temp_state) elseif (a:line1 == 0 || a:range == 1) && a:count > 0 - let edit = s:Mods(a:mods) . get(['edit', 'split', 'pedit', 'vsplit', 'tabedit'], a:count - (a:line1 ? a:line1 : 1), 'split') + let edit = s:Mods(a:mods) . get(['edit', 'split', 'pedit', 'vsplit', 'tabedit', 'edit'], a:count - (a:line1 ? a:line1 : 1), 'split') return s:BlameCommit(edit, get(readfile(temp), 0, ''), temp_state) else let temp = s:Resolve(temp) @@ -7279,14 +7279,16 @@ function! fugitive#MapJumps(...) abort if !&modifiable if get(b:, 'fugitive_type', '') ==# 'blob' let blame_tail = '=v:count ? " --reverse" : ""' - exe s:Map('n', '<2-LeftMouse>', ':0,1Git blame' . blame_tail, '') - exe s:Map('n', '', ':0,1Git blame' . blame_tail, '') if has('patch-8.0.1089') + exe s:Map('n', '<2-LeftMouse>', ':0,0Git ++curwin blame' . blame_tail, '') + exe s:Map('n', '', ':0,0Git ++curwin blame' . blame_tail, '') exe s:Map('n', 'o', ':0,0Git blame' . blame_tail, '') exe s:Map('n', 'p', ':0,0Git blame!' . blame_tail, '') exe s:Map('n', 'gO', ':vertical 0,0Git blame' . blame_tail, '') exe s:Map('n', 'O', ':tab 0,0Git blame' . blame_tail, '') else + exe s:Map('n', '<2-LeftMouse>', ':0,6Git blame' . blame_tail, '') + exe s:Map('n', '', ':0,6Git blame' . blame_tail, '') exe s:Map('n', 'o', ':0,2Git blame' . blame_tail, '') exe s:Map('n', 'p', ':0,3Git blame' . blame_tail, '') exe s:Map('n', 'gO', ':0,4Git blame' . blame_tail, '')