tomtom / quickfixsigns_vim

Mark quickfix & location list items with signs
http://www.vim.org/scripts/script.php?script_id=2584
GNU General Public License v3.0
131 stars 13 forks source link

vcs: fugitive's `Gwrite` sets signs, but should not #49

Open blueyed opened 10 years ago

blueyed commented 10 years ago

TEST CASE:

  1. open a (unmodified) file in a Git repository
  2. delete a line (dd)
  3. :Gwrite (writes the current file to the index)

quickfixsigns will place a -1 sign, although there is no (non-cached) difference.

A second :Gwrite will remove the sign.

The doautocmd code from fugitive is here: https://github.com/tpope/vim-fugitive/blob/master/plugin/fugitive.vim#L2211-L2215

tomtom commented 10 years ago

I'm sorry but I currently don't have the time to debug interaction with a plugin I personally don't use.

What's the path that is used for doautocmd?

blueyed commented 8 years ago

I was wrong about the doautocmd - at least it's not triggered currently anymore.

But instead the problem is just that fugitive writes the file, before adding it to the index: https://github.com/tpope/vim-fugitive/blob/9835920a3c91236021fc8c88cc4157304e24356b/plugin/fugitive.vim#L1527-L1541

tomtom commented 8 years ago

But instead the problem is just that fugitive writes the file, before adding it to the index

Is there still a problem then? Can it be fixed by using a different set of events for updating vcsdiff signs?

lnxbil commented 8 years ago

The problem is still present and I can solve it by rereading the file (e)

tomtom commented 8 years ago

You can try to define g:quickfixsigns_class_vcsdiffin vimrc

let g:quickfixsigns_class_vcsdiff = {'sign': '*quickfixsigns#vcsdiff#Signs', 'get': 'quickfixsigns#vcsdiff#GetList(%s)', 'event': ['BufRead', 'BufWritePost'], 'level': 6}

and maybe add other events to g:quickfixsigns_class_vcsdiff.event. If you don't find an appropriate event, you could ask t pope to call a User event in fugitive#reload_status().