From 59ce7a9e19ac73b3962ab32bf7cba6c11b4bd87c Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 1 Oct 2011 04:13:09 -0400 Subject: [PATCH] Restore blamed window on gq in blame --- doc/fugitive.txt | 4 +++- plugin/fugitive.vim | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/fugitive.txt b/doc/fugitive.txt index e2ae323..a4944a1 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -171,7 +171,9 @@ that are part of Git repositories). to reblame at that commit's [count]th parent (like HEAD^[count]). Press o or O to open up that commit in a horizontal of vertical split. Pressing q will - close the blame buffer. + close the blame buffer, and pressing gq will close the + blame buffer and return the targeted window to the + work tree version. :[range]Gblame [flags] Run git-blame on the given range. diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 5cf0227..cbea6ab 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1484,6 +1484,7 @@ function! s:Blame(bang,line1,line2,count,args) abort setlocal norelativenumber endif nnoremap q :exe substitute('bdelete'.bufwinnr(b:fugitive_blamed_bufnr).' wincmd w','-1','','') + nnoremap gq :exe substitute('bdelete'.bufwinnr(b:fugitive_blamed_bufnr).' wincmd wif expand("%:p") =~# "^fugitive:[\\/][\\/]"Geditendif','-1','','') nnoremap :exe BlameJump('') nnoremap P :exe BlameJump('^'.v:count1) nnoremap ~ :exe BlameJump('~'.v:count1)