Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

punctuation.delimiter treesitter group nearly invisible #329

Closed
jaywonchung opened this issue Jun 21, 2024 · 5 comments · Fixed by #331
Closed

punctuation.delimiter treesitter group nearly invisible #329

jaywonchung opened this issue Jun 21, 2024 · 5 comments · Fixed by #331

Comments

@jaywonchung
Copy link

Screenshot 2024-06-20 at 11 04 15 PM Screenshot 2024-06-20 at 11 06 28 PM

Somehow delimiters (e.g., :, ;, ,, .) are nearly invisible. I'm on Neovim 0.10.0 with the latest github-nvim-theme commit.

I checked :hi @punctuation.delimiter and nothing shows up, so it seems like no highlighting is defined for that group. Am I missing something?

Thanks.

@tmillr
Copy link
Member

tmillr commented Jun 21, 2024

Hi, thanks for reporting this. Which theme are you using?

The issue seems to have to do with the Delimiter hl group, which (currently) is supposed to be unhighlighted (and as a result take on the default fg color), but instead it seems that nvim is highlighting it with a default now. So this should be an easy fix.

@jaywonchung
Copy link
Author

Hey @tmillr, thanks for the response. I'm using colorscheme github_light.

@jaywonchung
Copy link
Author

jaywonchung commented Jun 21, 2024

Ah, I think this is related: neovim/neovim#26378

Similar thing happened in another repo: whatyouhide/vim-gotham#68
As reported above, I do see that my Delimiter group has guifg=NvimLightGrey2 after updating to 0.10.0

@jaywonchung
Copy link
Author

Without knowing what I'm doing, hi Delimiter guifg=NvimDarkGrey2 fixes the visibility issue at least. Could be a useful workaround until the issue is resolved.

@tmillr
Copy link
Member

tmillr commented Jun 21, 2024

Without knowing what I'm doing, hi Delimiter guifg=NvimDarkGrey2 fixes the visibility issue at least. Could be a useful workaround until the issue is resolved.

Yeah that's the hl group causing issues. It's part of nvim's (new?) defaults apparently (see :h gui-colors). For now, you can also set groups.all.Delimiter to {} in the setup() call. Running hi clear Delimiter after setting the colorscheme with :colorscheme also works. Strangely, just setting the colorscheme twice also appears to work, although that's probably not an ideal workaround.

I suppose what we need to do (one idea) going forward is to make sure to set/clear basically all highlight groups, including those which should just inherit the default fg:

-- Delimiter = { link = 'Special' }, -- character that needs attention

Idk if this needs to be done for all (e.g. linked) groups, but at least for base groups like Delimiter. Delimiter used to be considered a "minor" hl group which was linked to Special by default (:h group-name), but I guess this is no longer the case (i.e. all the asterisks have been removed–see below):

The names marked with * are the preferred groups; the others are minor groups.                                                                                                  
For the preferred groups, the "syntax.vim" file contains default highlighting.                                                                                                  
The minor groups are linked to the preferred groups, so they get the same                                                                                                       
highlighting.  You can override these defaults by using ":highlight" commands                                                                                                   
after sourcing the "syntax.vim" file.
From :h group-name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants