cocopon / iceberg.vim

:antarctica: Bluish color scheme for Vim and Neovim
https://cocopon.github.io/iceberg.vim/
MIT License
2.22k stars 132 forks source link

fix: treesitter highlights #107

Closed arrow2nd closed 1 year ago

arrow2nd commented 2 years ago

Thanks for the great color theme!

Fixed broken highlighting in some file types due to the discontinuation of the TS* highlight group in the latest treesitter.

https://github.com/nvim-treesitter/nvim-treesitter/issues/2293#issuecomment-1279974776

This is my first time editing a color theme, so I would appreciate it if you could let me know if there are any flaws.

Before

before

After

after

gzbd commented 1 year ago

Nice job. Since this commit in nvim-treesitter repo, old TS* highlight groups don't work anymore. Any chance merging this into master? I'm using @arrow2nd and LGTM

cocopon commented 1 year ago

Thank you for your contribution!

Is it okay to delete old declarations? I'm worried about the impact on people using the old environment.

arrow2nd commented 1 year ago

Indeed, it seems like a bad idea to delete the old declaration.

If so, should I modify it as follows?

Rules

call extend(rules, pgmnt#hi#group(
-      \ ['@function', '@function.builtin', '@function.macro'], {
+      \ ['TSFunction', 'TSFunctionBuiltin', 'TSFunctionMacro', '@function', '@function.builtin', '@function.macro'], {
        \   'ctermfg': c.pale,
        \   'guifg': g.pale,
        \ }))

Links

call add(links, pgmnt#hi#link('@attribute', 'Special'))
+ call add(links, pgmnt#hi#link('TSAttribute', '@attribute'))
arrow2nd commented 1 year ago

The removal of old declarations in treesitter has been undone.

Also, I noticed that the highlighting of comment tags (such as NOTE:) was broken, so I fixed it.

Before

image

After

image

cocopon commented 1 year ago

Merged, thanks!

cocopon commented 1 year ago

Some error occurred after merging this PR: #108

It seems that Vim doesn't support the name format like @foobar... do you know anything about this?

arrow2nd commented 1 year ago

It seems to be a Neovim-only specification that "@" can be used in group names.

https://neovim.io/doc/user/syntax.html

The name for a highlight or syntax group must consist of ASCII letters, digits, underscores, periods and @ characters. As a regexp it is [a-zA-Z0-9_.@]*.

I am not very familiar with Vim/Neovim yet, so I overlooked it. Sorry.

cocopon commented 1 year ago

Thank you for investigating. Provisionally I've reverted this change. #109