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 signs overlayed with generic marks #71

Open blueyed opened 7 years ago

blueyed commented 7 years ago

With the following signs for the same line, it would be nice to get the background of the "VCS ADD" sign:

    line=159  id=5345  name=QFS_Mark_.
    line=159  id=5343  name=QFS_Mark_'
    line=159  id=5340  name=QFS_VCS_CHANGE

Currently only the . sign is visible, which has no background and therefore no indication about this line being changed (with regard to the vcsdiff module).

To indicate that this line was added, it might be nice to have a sign there that merges QFS_Mark_. and QFS_VCS_CHANGE maybe, i.e. using the text from QFS_Mark_. with the texthl from QFS_VCS_CHANGE?!

Alternatively, it might be good to define/configure the order of signs, so that the vcs related ones would be placed after the more generic marks?!

tomtom commented 7 years ago

Alternatively, it might be good to define/configure the order of signs, so that the |vcs| related ones would be placed after the more generic marks?!

Sign definitions have a level field. For g:quickfixsigns_class_marks this is 4, for g:quickfixsigns_class_qfl it is 7. If you want qfl to take precedence, set it to 3 -- should work. Currently there is no way to configure just the level field easily.

blueyed commented 7 years ago

What I've meant is to merge them, which in this case would use the background from the QuickFixSignsDiffAdd highlight and the text from the other mark. This would allow for having added/changed lines being highlighted always.

For this to work there would need to be intermediate texthl classes for the signs, e.g. QFS_WarningMsg (mentioned in TODO), and then e.g. QFS_WarningMsg_VCSAdd (which would take the bg from QuickFixSignsDiffAdd). In case a line is then added, but was also the one being last changed, it would use QFS_Mark_._VCSAdd, which would display as . with a green background.

It's not trivial, but hopefully you get what I mean at least?! :)

tomtom commented 7 years ago

I think merging is a bad idea. Signs are a pain anyway. I think you should use the level mechanism but ... Anyway, I realized that level doesn't work as it is supposed to. It seems that unneeded signs aren't removed properly. Unfortunately, I don't have the time to come up with a solution for this.