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

ErrorText highlight looks broken on neovim 0.10 #205

Closed
tranzystorekk opened this issue May 21, 2024 · 16 comments
Closed

ErrorText highlight looks broken on neovim 0.10 #205

tranzystorekk opened this issue May 21, 2024 · 16 comments

Comments

@tranzystorekk
Copy link

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
Copy link
Collaborator

antoineco commented May 21, 2024

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
Copy link
Collaborator

antoineco commented May 21, 2024

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
Copy link
Author

tranzystorekk commented May 21, 2024

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
Copy link
Collaborator

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
Copy link
Author

tranzystorekk commented May 21, 2024

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
Copy link
Collaborator

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
Copy link
Author

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

@tranzystorekk
Copy link
Author

tranzystorekk commented May 21, 2024

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
Copy link
Collaborator

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
Copy link
Collaborator

Cross referencing

@tranzystorekk
Copy link
Author

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

@antoineco
Copy link
Collaborator

antoineco commented May 21, 2024

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
Copy link
Author

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

  • zellij has support for styled_underlines, barring exceptions if the terminal doesn't cooperate well
  • wezterm claims to support those (on stable AFAIU) as well in the FAQ, but with the not-entirely-clear note that windows's ConPTY gives some additional trouble

@antoineco
Copy link
Collaborator

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
Copy link
Author

tranzystorekk commented May 21, 2024

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
Copy link
Collaborator

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

@antoineco antoineco closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
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

No branches or pull requests

2 participants