Background:
It's possible for multiple highlights to affect the same areas in the buffer and work correctly. For example syntax-related colors usually affect fg
(foreground, text glyph) color, diagnostic style highlights apply stuff like curled underlines that apply guisp
(color that applies for underlines), and there are more properties that we can independently applied to the same text without conflicting such as italic, bold, and bg color.
However, for visual reasons, there are situations when I would want bgcolors conflicting and control which to take precedence. The question is when I have multiple plugins is there a global priority mechanism I can use to force certain highlight groups to "trump" others when they conflict?
The current example:
GitSigns plugin applies word-diff highlights for added and changed zones within the buffer (highlight group GitSignsAddInline
). I am having trouble convincing another highlight group (highlight group YankyPut
) to take precedence over it. YankyPut
is ephemeral and disappears after a timeout.
As I understand it, the way it works is that maybe the last-defined highlight group takes precedence? It can be kind of hard to test actually. Let's suppose that is the case. Then if in this example GitSigns for whatever reason has to legitimately re-set its groups on a regular basis then that makes it nearly impossible for me to ensure that the Yanky highlight group is then defined afterwards. It would not be sensible to introduce some sort of communication dependency across these unrelated plugins.
Please do not offer "change YankyPut to use underline" as a solution. That will certainly work, that's not what I'm interested in. I just want to understand how I can gain more precise control over conflicting higroups set on the same areas of the buffer.