sainnhe / gruvbox-material

Gruvbox with Material Palette
MIT License
1.96k stars 166 forks source link

ErrorText highlight looks broken on neovim 0.10 #205

Closed tranzystorekk closed 6 months ago

tranzystorekk commented 6 months ago

After switching to neovim 0.10, my lsp error highlights started looking weird (the 3600a text):

image

This seems consistent with what gruvbox-material uses with diagnostic_text_highlight = 1, but I have that option disabled in the screenshot above.

antoineco commented 6 months ago

Could you please share details about your terminal emulator and colorscheme configuration?

Here how the sample code renders for me on WezTerm (latest nightly) with the following colorscheme config (lazy.nvim + Neovim 0.10):

  {
    "sainnhe/gruvbox-material",
    lazy = false,
    priority = 1000,
    config = function()
      vim.g.gruvbox_material_enable_italic = true
      vim.cmd.colorscheme('gruvbox-material')
    end
  },

image

edit: the same as above with vim.g.gruvbox_material_diagnostic_virtual_text = 'highlighted', which you seem to have enabled:

image

antoineco commented 6 months ago

Another useful information would be the output of :Inspect while the cursor is inside the problematic region. Here is mine for reference:

image

image

tranzystorekk commented 6 months ago

configuration:

  {
    "sainnhe/gruvbox-material",
    lazy = false,
    priority = 1000, -- make sure to load this before all the other start plugins
    config = function()
      vim.g.gruvbox_material_background = "hard"
      vim.g.gruvbox_material_ui_contrast = "high"
      vim.g.gruvbox_material_inlay_hints_background = "dimmed"
      vim.g.gruvbox_material_dim_inactive_windows = 1
      vim.g.gruvbox_material_diagnostic_virtual_text = "highlighted"

      -- NOTE: Needs to be called last for the settings to take effect
      vim.cmd.colorscheme("gruvbox-material")
    end,
  },

terminal is wezterm version: 20240203-110809-5046fc22 x86_64-pc-windows-msvc

:Inspect:

image

I checked right now and this doesn't happen on my other foot terminal config, so it probably is wezterm specific

antoineco commented 6 months ago

What is the output of echo $TERM inside your terminal? (outside of Neovim)

Does it also occur if you install and enable the wezterm terminfo?

If you want to get the most application support out of wezterm, then you may wish to install a copy of the wezterm TERM definition: [instructions follow] -- https://wezfurlong.org/wezterm/config/lua/config/term.html

tranzystorekk commented 6 months ago

Does it also occur if you install and enable the wezterm terminfo?

Unfortunately yes, I use Wezterm on Windows to run my WSL2 linux, after adding config.term = 'wezterm', installing wezterm-terminfo on WSL and ensuring echo $TERM prints wezterm and that infocmp lists wezterm's caps, the issue hasn't changed

antoineco commented 6 months ago

I use WezTerm on Windows 11 and run Neovim inside WSL2 (Debian 12) too.

I have to admit that I just ran out of ideas.

tranzystorekk commented 6 months ago

I'll try poking around the wezterm community, but thank you for taking the time to help me!

tranzystorekk commented 6 months ago

Okay, one more thing I forgot to mention, I'm also using zellij in that setup, and indeed when switching it off, the highlight at least doesn't have the background color:

image

EDIT: changing zellij configuration to styled_underlines false also works around the issue for now

antoineco commented 6 months ago

Ah that's some progress!

Support for undercurl on Windows is currently only available in WezTerm nightly, so that would explain the absence of undercurl for you.

antoineco commented 6 months ago

Cross referencing

tranzystorekk commented 6 months ago

Unless you think this report has some other value, I don't think gruvbox-material is to blame, so I can close.

antoineco commented 6 months ago

I agree that there is probably not much we can do inside the colorscheme, besides changing the default style of diagnostic texts to not use undercurl. The undercurl was a conscious design decision of sainnhe though, and my preference would be to document how users can ensure that their environment is properly configured to support it.

However, I am interested in the resolution. Terminal multiplexers have been historically problematic with things like italics, standout and fancy underlines. If we can have a note about Zellij inside the vimdoc, I'm all for it!

tranzystorekk commented 6 months ago

Hm, I tried to collect info from both wezterm and zellij, and I'm not entirely sure what to make of it:

antoineco commented 6 months ago

WezTerm has been supporting undercurl for a long time on Linux and macOS, but had a dependency on ConPTY and OpenConsole (from Windows Terminal) on Windows, which added support for undercurl only recently. Wez included those updated files on Feb. 11, whereas the latest stable was released on Feb. 3. In case you haven't tried the nightly release, it might be worth giving it a shot (it has been very stable for me so far).

I can't talk authoritatively about Zellij because I have never used it. I remember having a lot of similar issues with Tmux when I wasn't setting the terminfo to tmux-256color, but Zellij doesn't seem to require this if I understand correctly.

tranzystorekk commented 6 months ago

Some additional tests on wezterm version: 20240520-135708-b8f94c47 x86_64-pc-windows-msvc and zellij 0.40.1:

zellij disabled, outside of neovim:

image

zellij enabled, outside of neovim:

image

zellij disabled, in neovim:

image

zellij enabled, in neovim:

image

antoineco commented 6 months ago

Looks like Zellij needs to work on its compatibility with Neovim 0.10 🙂 Thanks for sharing the result of your experiments!