Work around Vim issue with hidden diff window

If you call :Gdiff on a file that's also open in a separate tab, close
it, switch to another file, and call :Gdiff again, Vim thinks the first
file is part of a 3-way diff, despite no longer being displayed in a
window.  Curiously, :diffoff! seems to work around this, despite both
the documentation and source code suggesting it merely iterates over
open windows.

Closes https://github.com/tpope/vim-fugitive/issues/534
This commit is contained in:
Tim Pope
2017-05-19 18:14:55 -04:00
parent 1d2f150331
commit d6e7e20123

View File

@@ -1391,6 +1391,7 @@ function! s:Edit(cmd,bang,...) abort
endif
endif
endfor
diffoff!
endif
endif
endif