Open meijieru opened 2 years ago
The text of blue color should not be italicized.
I did some debug, and found that it's a bug of tree-sitter.
This line:
https://github.com/sainnhe/edge/blob/f2c8e3d2a72f3763e3ea9c620a118e73e2146fb1/colors/edge.vim#L365
Will link TSFuncBuiltin
to Blue
. TSFuncBuiltin
controls the color of builtin functions like print()
, open()
and len()
. The Blue
highlight group is defined here:
https://github.com/sainnhe/edge/blob/f2c8e3d2a72f3763e3ea9c620a118e73e2146fb1/colors/edge.vim#L236
The output of :hi Blue
:
:hi Blue
Blue xxx ctermfg=110 guifg=#6cb6eb
Press ENTER or type command to continue
As you can see, TSFuncBuiltin
is linked to Blue
which is NOT italicized.
But it is italicized here.
IMO, it's a bug of nvim-treesitter, report this to their repo.
I'm facing the same kind of issues whenever I use Edge. And yes, this behaviour comes from Treesitter and it doesn't seem like Neovim offers a way to counteract it. I just opened https://github.com/nvim-treesitter/nvim-treesitter/issues/3396.
The problem with Treesitter is that, since highlight attributes are inherited, anything with TSVariable
as parent will inherit the italic
attribute of that parent (or any other attribute):
Unfortunately, even forcing the child's attributes to NONE
(which Edge does anyway) doesn't seem to reset the attributes inherited from the parent.
highlight! Blue cterm=NONE gui=NONE " no effect
This seems to be a recurring issue in any color scheme that sets non-NONE
highlight attributes on TSVariable
.
Here is a workaround that solves most (all?) issues related to inherited attributes:
hi Fg gui=nocombine
hi Grey gui=nocombine
hi Red gui=nocombine
hi Yellow gui=nocombine
hi Green gui=nocombine
hi Cyan gui=nocombine
hi Blue gui=nocombine
hi Purple gui=nocombine
Maybe we could make gui=nocombine
the default for these base groups.
Operating system/version
WSL2
Terminal emulator/version
wezterm
$TERM environment variable
xterm-256color
Tmux version
No response
Feature matrix
Minimal vimrc that can reproduce this bug.
Steps to reproduce this bug using minimal vimrc
Use the above config
Expected behavior
Like gruvbox-material, some texts are italic
Actual behavior
Almost everything is italic![image](https://user-images.githubusercontent.com/9511136/142096410-aaaa47f7-43b5-4dad-89e1-ca0aafa66a05.png)