Closed Geobert closed 3 months ago
Thanks for reporting 👍
The faulty highlight group is SpecialKey
, which is documented^1 as follows:
*hl-SpecialKey*
SpecialKey Unprintable characters: Text displayed differently from what
it really is. But not 'listchars' whitespace. |hl-Whitespace|
Neovim's default colorscheme uses a fairly dark color as well for this highlight group (see below), but I agree that Sonokai's foreground color is way too dark.
Here is the code location, for reference: https://github.com/sainnhe/sonokai/blob/16fa31a4/colors/sonokai.vim#L100
I'm not yet sure what to do with this. The fact that noice.nvim shows this output in a pop-up window (lighter background by default in Sonokai) makes the text even more difficult to read. We could improve that particular output by assigning SpecialKey
the same foreground color as Conceal
, but:
SpecialKey
is encountered rarely and should probably remain distinct from Conceal
cmd('last')
to display the output of Vim built-in commands like :map
feels like an anti-pattern to me (I could be wrong)If you are using noice.nvim extensively, I suggest setting vim.g.sonokai_float_style = 'dim'
inside your configuration. This will ensure that pop-up windows have a darker background than the normal window, instead of lighter. This alone will already improve the legibility of this particular text.
In case this is not enough, we could maybe consider using a different color than a shade of grey for SpecialKey
, but I first need to do a little research to understand what the other usages of this highlight group are in the wild.
Thanks for looking into this! :)
With dim
:
Slightly better but I’m afraid we need to do better :-/
How can I reproduce the output above? If this is still the output of cmd('last')
, what was the last command?
It was LazyVim notifying available update for plugins.
otherwise a map
will output problematic colors
I was asking because I am not convinced that SpecialKey
is being used in the LazyVim plugins output above, other similar highlight groups include NonText
and Conceal
. Noice.nvim adds a level of indirection which makes it difficult to know what core highlight is being used without inspecting the same output outside of noice's pop-ups.
It seems like the output above uses Conceal
to highlight notify.info
. Here is Sonokai compared with Neovim's default colorscheme:
While I agree that the contrast is low in Sonokai for concealed text due to the colorscheme's lighter background, this was a conscious design decision, because we do want non-text to be dimmed in the colorscheme (some synonyms of "conceal" are "hide", "mask"). The documented usage for these special highlights applies to specific characters (placeholders, substituted for hidden text); using these to highlight entire chunks of texts is a misuse.
Likewise, if LazyVim deliberately uses Conceal
to highlight certain parts of notifications, it is precisely because the author meant for that text to be concealed. If it's not what they meant, the highlight should be changed from Conceal
to something more appropriate.
Given how configurable LazyVim is, I would be surprised if there wasn't a way to override this in the notification subsystem.
While we are most likely not going to touch Conceal
and NonText
in Sonokai, I think it would be reasonable to lighten SpecialKey
. The only usages of SpecialKey
I can think of besides :map
are newline characters printed while opening a DOS file in the Unix file format. We do want these to stand out to some extent. Here is Sonokai side-by-side with another colorscheme:
My proposal is to highlight SpecialKey
using Sonokai's purple color instead of bg4. It think it fits very well with the rest of the colorscheme, and makes a few outputs much more readable than they currently are:
@sainnhe do you have anything against that change? Maybe you can think of a usage of SpecialKey
where text should preferably stay dimmed?
The change is now on master
. Please feel free to report any possible glitch resulting from making SpecialKey
purple. Thank you for your patience!
I have done the following steps before reporting this issue:
Operating system/version
Win 11
GUI client/version
neovide 0.13.1
Feature matrix
Minimal vimrc that can reproduce this bug.
Use LazyVim defaults, then add sonokai, atlantis version
Steps to reproduce this bug using minimal vimrc
Using defaults keymaps
<space>snl
to pop the last messagesome text are not readable because of using bg4
Expected behavior
a readable color
Actual behavior