From 08a9a45dbc3cce0af3f246013240d71aa2519ac0 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 13 Aug 2019 15:58:10 -0400 Subject: [PATCH] Support :rightbelow Gblame and other Closes https://github.com/tpope/vim-fugitive/issues/976 --- autoload/fugitive.vim | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 2f5b117..73b65cc 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -4763,15 +4763,20 @@ function! s:BlameSubcommand(line1, count, range, bang, mods, args) abort let temp = s:Resolve(temp) let s:temp_files[s:cpath(temp)] = temp_state if len(ranges + commits + files) || raw + let mods = s:Mods(a:mods) if a:count != 0 - exe 'silent keepalt split ' . s:fnameescape(temp) + exe 'silent keepalt' mods 'split' . s:fnameescape(temp) elseif !&modified || a:bang || &bufhidden ==# 'hide' || (empty(&bufhidden) && &hidden) - exe 'silent edit' . (a:bang ? '! ' : ' ') . s:fnameescape(temp) + exe 'silent' mods 'edit' . (a:bang ? '! ' : ' ') . s:fnameescape(temp) else - return 'edit ' . s:fnameescape(temp) + return mods . 'edit ' . s:fnameescape(temp) endif return '' endif + if a:mods =~# '\' + silent tabedit % + endif + let mods = substitute(a:mods, '\', '', 'g') for winnr in range(winnr('$'),1,-1) if getwinvar(winnr, '&scrollbind') call setwinvar(winnr, '&scrollbind', 0) @@ -4801,7 +4806,7 @@ function! s:BlameSubcommand(line1, count, range, bang, mods, args) abort endif let top = line('w0') + &scrolloff let current = line('.') - exe 'silent keepalt' (a:bang ? 'split' : 'leftabove vsplit') s:fnameescape(temp) + exe 'silent keepalt' (a:bang ? s:Mods(mods) . 'split' : s:Mods(mods, 'leftabove') . 'vsplit') s:fnameescape(temp) let w:fugitive_leave = restore execute top normal! zt