tomtom/quickfixsigns_vim

Reload/reset signs after `Gcommit` etc

blueyed opened this issue · 11 comments

When using :Gcommit from fugitive, I would like to reset the cache(s) for all VCS signs.

How would that get achieved?

Does call QuickfixsignsSet('', ['vcsdiff']) help?

pjrt commented

That does clear them, but shouldn't they clear out on the normal events? (BuffEnter, InsertEnter, etc)? They seem to stay around for me.

That does clear them, but shouldn't they clear out on the normal
events? (BuffEnter, InsertEnter, etc)? They seem to stay around for me.

Of course they should, don't they?

I assumed the OP wants immediate feedback and doesn't want to wait for
the next scheduled update.

pjrt commented

Unn, strange, I used to be able to reproduce it not clearing out after commit (had to close and open vim) yesterday. But I can't reproduce it anymore.

I'll keep an eye out.

pjrt commented

Ah, I was able to reproduce it, but only in MacVim (have not tried gvim).

Test Case:

  • Get some code in version control
  • Edit the code (notice the marks come up) and save in MacVim
  • Commit the code
  • Go back to MacVim, notice the marks are still there.
  • Save the file, marks don't go away
  • Read the file (:e), marks still there
  • Change buffers and move, marks still there
  • Close buffer (:bdelete) and open again, marks are gone
  • Close MacVim and reopen, marks are gone.

vim (mvim) version 7.3

However, normal vim (in the terminal) works fine.

Does call QuickfixsignsSet('', ['vcsdiff']) help?

This works for me. IIRC fugitive calls some user autocommand, which quickfixsigns then could listen for (or the user in their config).

IIRC fugitive calls some user autocommand, which quickfixsigns then
could listen for (or the user in their config).

Do you have any details? I wasn't able to find out which user event
would be triggered by Gcommit.

  • Get some code in version control
  • Edit the code (notice the marks come up) and save in MacVim
  • Commit the code
  • Go back to MacVim, notice the marks are still there.
  • Save the file, marks don't go away

Ok, I think I understand the problem.

pjrt commented

That seems to have fixed it. Thanks!

@tomtom
The initial issue has not been fixed (reloading signs after a fugitive command / :Gcommit), has it?

As stated in tpope/vim-fugitive#458 (comment), it would probably work to hook into ShellCmdPost.

You can add ShellCmdPost to g:quickfixsigns_class_vcsdiff.event if you really want to. I don't think I would want to make this a default though since it assumes a certain workflow. IMHO fugitive should define a User event and trigger that one in #reload_status() or whatever. This would also solve your problem with Gwrite, I guess.