will133 / vim-dirdiff

Vim plugin to diff two directories
335 stars 59 forks source link

it would be nice to have more stable window layout #8

Closed tex closed 5 years ago

tex commented 8 years ago

when you hit enter on some file and then on different file, all buffers are closed and then re-created. this causes heavy flickering.

will133 commented 8 years ago

Yeah, this is pretty annoying to me too. I'm doing essentially a vim diffsplit. I'm not sure how I can replace the buffers without closing them first though. If you know of a better way to do this, I'd be happy to investigate.

tex commented 8 years ago

This https://github.com/dkprice/vim-dirdiff/commit/5d0181b38ab55217814a79bb6ee6e7dd16611feb does seem to work. I had a problem with it though when using neovim - it freezes neovim after a few diffs...

junkblocker commented 8 years ago

FYI, drop use in that https://github.com/dkprice/vim-dirdiff/commit/5d0181b38ab55217814a79bb6ee6e7dd16611feb implementation has problem with symlinked filenames while the current implementation does not. drop takes you to the same buffer for a symlink or original causing complete breakage of the dirdiff logic there.

Here's a simple test to compare:

mkdir -p {old,new}vim/.vim
echo foo > oldvim/.vimrc
echo bar > newvim/.vimrc
ln -s ../../oldvim/.vimrc oldvim/.vim/init.vim
ln -s ../../newvim/.vimrc newvim/.vim/init.vim
vim +'DirDiff oldvim newvim'

In this when you move to the next diff without changing anything in the first one that opens, the drop based implementation breaks.

A possible fix could be to do own implementation of drop with :enew + :edit.

will133 commented 6 years ago

I've not touched this for a while, but if anybody is interested in submitting a pull request with the latest master with this change I can take a look again.

tex commented 6 years ago

@will133 done, here you are