From e065e4f841f4a033ac9a6156573a446007617b1d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 11 Dec 2014 04:03:08 +0100 Subject: [PATCH] (Re)store the current window in `s:diffoff_all` This is required to make Vim execute the "Enter" autocommands when closing the fugitive window. Fixes: https://github.com/tpope/vim-fugitive/issues/421 --- plugin/fugitive.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index f037b65..0ee9d04 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1681,6 +1681,7 @@ function! s:diffoff() abort endfunction function! s:diffoff_all(dir) abort + let curwin = winnr() for nr in range(1,winnr('$')) if getwinvar(nr,'&diff') if nr != winnr() @@ -1692,6 +1693,7 @@ function! s:diffoff_all(dir) abort endif endif endfor + execute curwin.'wincmd w' endfunction function! s:buffer_compare_age(commit) dict abort