From 589e8b51c2357b9362e637ce37fdbb14537df80f Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 20 May 2022 11:36:28 -0400 Subject: [PATCH] Track correct window when blaming twice-open buffer Resolves: https://github.com/tpope/vim-fugitive/issues/1992 --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index a73a99f..909c424 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -6939,7 +6939,7 @@ function! s:BlameSubcommand(line1, count, range, bang, mods, options) abort execute winbufnr(winnr).'bdelete' endif endfor - let restore_winnr = 'bufwinnr(' . bufnr . ')' + let restore_winnr = exists('*win_getid') ? win_getid() : 'bufwinnr(' . bufnr . ')' if !&l:scrollbind call add(restore, 'call setwinvar(' . restore_winnr . ',"&scrollbind",0)') endif