dracula / vim

🧛🏻‍♂️ Dark theme for Vim
https://draculatheme.com/vim
MIT License
1.34k stars 454 forks source link

The highlighting of diagnostics should not change the color of the entire line of text. #326

Closed scottming closed 4 months ago

scottming commented 4 months ago

What happened

I noticed that Dracula has some issues with the highlighting of diagnostics. When it receives a range, Dracula turns all the text within that range orange. Notice line 6 in the screenshot. This is very disruptive when editing code and has poor readability. Nowadays, almost all LSPs return diagnostics in real-time, and returning a range for an entire line is very common.

image

What I expected to happen

What I want is an effect like One Dark, where only the wavy underline is changed, instead of changing the color of all the text.

Discord 2024-07-18 15 50 34

Machine Info

Additional Info

benknoble commented 4 months ago

@stnley or @I-Want-To-Believe is this in your wheel house? Maybe @dsifford ? I directed @scottming here hoping we could get some more eyes with better expertise on this.

Apparently it used to look as desired; @scottming if you have time to try bisecting this repo to see what changed, that would be helpful. It may have been a change in Vim or Neovim, though, in which case that won't find anything.

stnley commented 4 months ago

I believe the reason is https://github.com/neovim/neovim/pull/22382

When checking for special attribute support we use has('gui_running'). This returns 0 and 1 when running neovim in TUI and GUI (nvim-qt) respectively.

Setting g:dracula_full_special_attrs_support = 1 appears to fix the issue, however the colors aren't displaying quite right on every terminal (foot doesn't work, kitty works). That could be unrelated, I'll test some more.

Kitty with g:dracula_full_special_attrs_support = 0 1721529488_grimshot

Kitty with g:dracula_full_special_attrs_support = 1 1721529504_grimshot

nvim-qt 1721524326_grimshot

@scottming could you try setting that variable and let me know if it works for you?

stnley commented 4 months ago

Sorry, I noticed you included you mentioned you're using alacritty. It appears to have the same issue foot has, the colors aren't quite right.

1721529832_grimshot

scottming commented 4 months ago

@stnley Yes, this configuration solves the problem. Thank you. This is the effect I wanted.

CleanShot 2024-07-21 at 12 03 47@2x

benknoble commented 4 months ago

I can confirm that Alacritty's undercurl (when using let g:dracula_full_special_attrs_support = 1) uses the syntax color of the underlying text, not the highlight color. I get a squiggle, though, not a solid bar. Thanks @stnley for taking a look!