From d6e7e20123ef3892c041e4d9fbaf67a68b144a94 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 19 May 2017 18:14:55 -0400 Subject: [PATCH] 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 --- plugin/fugitive.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index ea5af32..9cda172 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1391,6 +1391,7 @@ function! s:Edit(cmd,bang,...) abort endif endif endfor + diffoff! endif endif endif