lambdalisue / vim-gina

👣 Asynchronously control git repositories in Neovim/Vim 8
http://www.vim.org/scripts/script.php?script_id=5531
MIT License
688 stars 27 forks source link

Exiting patch does not clear diff highlighting from worktree #95

Closed SevereOverfl0w closed 7 years ago

SevereOverfl0w commented 7 years ago

Reproduce:

  1. :Gina patch
  2. :q (in index)

:diffoff seems to turn off the highlighting as a workaround. But there is probably a proper way to do it.

lambdalisue commented 7 years ago

It is a Vim's problem.

echo "Hello\nWorld" > a.txt
echo "Hello\nworld" > b.txt
echo "foobar" > c.txt
vim
:e a.txt
:diffthis
:enew b.txt
:diffthis
:q

Additionally, it is really problem when you open a different buffer like

:enew c.txt
:diffthis
SevereOverfl0w commented 7 years ago

I see. Looks like fugitive includes an aucmd to change this behaviour https://github.com/tpope/vim-fugitive/blob/d6e7e20123ef3892c041e4d9fbaf67a68b144a94/plugin/fugitive.vim#L1682-L1692

lambdalisue commented 7 years ago

Prob fixed. https://github.com/lambdalisue/gina.vim/commit/3f5975a5457164a5d3e7b97ca465cca33b27aca7