Closed brxxlstxrs closed 2 years ago
Does :verbose highlight DiagnosticHint
show the same color?
If yes, what's its value?
Does
:verbose highlight DiagnosticHint
show the same color?If yes, what's its value?
:verbose highlight DiagnosticHint
DiagnosticHint xxx ctermfg=7 guifg=LightGrey
links to HintText
Last set from ~/.config/nvim/colors/gruvbox-material.vim line 246
As I said before: I copy colors/gruvbox-material.vim
( 7. To install lualine theme,
copy /path/to/gruvbox-material/lua/lualine/themes/gruvbox-material.lua
to ~/.config/nvim/lua/lualine/themes/
.)
In neovim colors
dir is .config/nvim/colors
And I follow 1-4 steps too
I think the color you're seeing is #273faf
, which is Lualine's fallback when it cannot find any of the DiagnosticHint
, LspDiagnosticsDefaultHint
or DiffChange
highlight groups.
Gruvbox-material definitely sets these highlight groups, so to me this looks like an issue with the order things are loaded.
Try adding packadd! gruvbox-material
and coloscheme gruvbox-material
to your Neovim init file, not by typing commands manually. This will ensure that the color scheme is loaded before the plugins.
Loading the color scheme manually is also possible, but then you need to initialize all the plugins which depend on it again, also manually, like this:
:lua require'lualine'.setup({options = {theme = 'gruvbox-material'}})
I think the color you're seeing is
#273faf
, which is Lualine's fallback when it cannot find any of theDiagnosticHint
,LspDiagnosticsDefaultHint
orDiffChange
highlight groups.Gruvbox-material definitely sets these highlight groups, so to me this looks like an issue with the order things are loaded.
Try adding
packadd! gruvbox-material
andcoloscheme gruvbox-material
to your Neovim init file, not by typing commands manually. This will ensure that the color scheme is loaded before the plugins.Loading the color scheme manually is also possible, but then you need to initialize all the plugins which depend on it again, also manually.
Already done all of it and
its not working for me.
And why its happening after I copy /path/to/gruvbox-material/lua/lualine/themes/gruvbox-material.lua
to ~/.config/nvim/lua/lualine/themes/
What happens if you execute this manually after starting Neovim?
:lua require'lualine'.setup({options = {theme = 'gruvbox-material'}})
Its very strange, because if focus on the code, then in the colors folder of the repository, the values of (Diagnostic)*Hint*
contain links to TextHint
(its green)
Confirmed. I'm observing the same behaviour. Thanks for reporting!
The good news is: I found the root cause.
Gruvbox-material doesn't set any foreground color for HintText
, InfoText
, WarnText
and ErrorText
. Instead, it uses the undercurl
highlight style, as shown below:
As a result, lualine assumes those groups don't have any color, and falls back to its default values of #273faf
, #ffffff
, #ffa500
and #e32636
.
Now, if I apply a foreground color to HintText
and reload lualine, the bulb icon and the number turn green as expected:
:highlight HintText guifg=#a9b665
:lua require'lualine'.setup{options = { theme = 'gruvbox-material' }}
This is going to be slightly problematic because I don't think we want to touch the current style of the highlight groups used by default by lualine: DiagnosticHint
, DiagnosticInfo
, DiagnosticWarn
and DiagnosticError
.
However, it is possible to configure lualine to use specific colors from the gruvbox-material palette:
local palette = vim.fn['gruvbox_material#get_palette']('medium', 'material', {[vim.type_idx]=vim.types.dictionary})
require'lualine'.setup{
options = {
theme = 'gruvbox-material',
diagnostics_color = {
hint = { fg = palette['green'][1] },
info = { fg = palette['blue'][1] },
warn = { fg = palette['yellow'][1] },
error = { fg = palette['red'][1] },
}
}
}
Result:
It doesn't feel ideal, but considering lualine's default behaviour, I think this is the most reasonable approach.
Thanks, now I set it to me, but with 'mix' colors.(I'm not sure why the problem still exists, why no one noticed it, because a lot of people probably use all these plugins along with this theme, but I'm not sure, because it's more focused on vim syntax and not lua, not very much use lualine)
and also does this plugin have bufferline.nvim support?
I also wonder why. I personally don't use Lualine because the way it refreshes on a timer used to cause a bunch of issues for me, and I know that the Neovim ecosystem has so many alternatives that it's hard to support every use case: feline, heirline, mini, NvChad, ...
Since Lualine is popular, maybe I could send them a pull request to suggest falling back to the underline color if no foreground color was defined. The maintainers will most likely tell me it's too opinionated, but it's worth a try.
Meanwhile, I added a note about this behaviour to the FAQ 👇
@brxxlstxrs to your other question, bufferline is supported, but it might need some tweaking to make it look even nicer. In case you find some possible improvements, feel free to suggest them in a new issue.
@brxxlstxrs FYI my patch was accepted in Lualine (much faster than I anticipated; https://github.com/nvim-lualine/lualine.nvim/pull/836), so if you update to the latest version, the underline color of the Diagnostic highlight groups will be used if they exist.
This means you don't need to set diagnostics_color
manually anymore inside Lualine's configuration. Things will just work out of the box with Gruvbox Material.
I have done the following steps before reporting this issue:
Operating system/version
Arch Linux x86_64
Terminal emulator/version
alacritty 0.10.1
$TERM environment variable
alacritty
Tmux version
No response
Feature matrix
Minimal vimrc that can reproduce this bug.
Steps to reproduce this bug using minimal vimrc
:help gruvbox-material.txt
and step to install for lualine (7)pyright
)minimal.lua
config, do:PackerSync
and reload nvimExpected behavior
Same lsp diagnostics colors in lualine as in code
Actual behavior
Dark blue colors