(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
This commit is contained in:
Daniel Hahler
2014-12-11 04:03:08 +01:00
committed by Tim Pope
parent 21b6dd7aee
commit e065e4f841

View File

@@ -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