commit 98b7334209e0c8a06f296e5e89bd813296e67fe2 (tree)
parent a1bdea305bcb7d5eebd15bfd10ad130d09b3e2f3
Author: Tim Pope <code@tpope.net>
Date: Tue, 4 Oct 2011 03:13:46 -0400
Close old blame windows before new blame
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim
@@ -1456,6 +1456,12 @@ function! s:Blame(bang,line1,line2,count,args) abort
if v:shell_error
call s:throw(join(readfile(error),"\n"))
endif
+ for winnr in range(winnr('$'),1,-1)
+ call setwinvar(winnr, '&scrollbind', 0)
+ if getbufvar(winbufnr(winnr), 'fugitive_blamed_bufnr')
+ execute winbufnr(winnr).'bdelete'
+ endif
+ endfor
let bufnr = bufnr('')
let restore = 'call setwinvar(bufwinnr('.bufnr.'),"&scrollbind",0)'
if &l:wrap
@@ -1464,9 +1470,6 @@ function! s:Blame(bang,line1,line2,count,args) abort
if &l:foldenable
let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&foldenable",1)'
endif
- let winnr = winnr()
- windo set noscrollbind
- exe winnr.'wincmd w'
setlocal scrollbind nowrap nofoldenable
let top = line('w0') + &scrolloff
let current = line('.')