HiPhish / nvim-ts-rainbow2

Rainbow delimiters for Neovim through Tree-sitter
https://gitlab.com/HiPhish/nvim-ts-rainbow2
Apache License 2.0
339 stars 35 forks source link

[Bug] Punctuation highlight is changed to deprecated `TSPunctBracket` #35

Closed akinsho closed 1 year ago

akinsho commented 1 year ago

Describe the bug

Whilst using this plugin the highlight for brackets that aren't being coloured using rainbow colours is set to the since deprecated TSPuncBracket highlight group. There appears to be a check to see if the hl_map exists a check I think plugins used pre nvim 0.7 or 0.8 when these groups where deprecated but rather than just depending on the @punctation.bracket or using TSPunctBracket the plugin seems to overriding a users settings

https://github.com/HiPhish/nvim-ts-rainbow2/blob/3bfcb9a7dd55d106f2e8afd3dcaec1ac624db2db/lua/ts-rainbow/internal.lua#L85-L89

Steps to reproduce

This is visible whilst using the local strategy and moving through a file. The highlights for un highlighted regions is mutated to TSPunctBracket. My colorscheme (which I develop) doesn't support the TS* highlight groups as it doesn't target anything lower than 0.8 (being that it's days old)

Expected behavior

Punctuation highlights should be left unchanged if not "rainbow-ed".

Screenshots

Without this plugin (brackets are a gray colour)

image

With this plugin (brackets are the same colour as the foreground)

image
akinsho commented 1 year ago

This might be solvable by adding a default = true when linking although I don't know that it's right to be trying to link this group to a now deprecated highlight group 🤷🏾‍♂️

HiPhish commented 1 year ago

I don't know why I am doing any of this in the first place. It might be a leftover from the original plugin. I will see if I can just throw it all away.

HiPhish commented 1 year ago

I have now removed the offending code, please test the current master.

akinsho commented 1 year ago

LGTM thanks 👍🏾