Way i use sainnhe/gruvbox-material has some problem #1342
-
This plugin seems to conflict with neodim, specifically it seems to be a problem with the return value of this function in neodim config local blend_color = require("modules.utils").gen_neodim_blend_attr()
function M.hl_to_rgb(hl_group, use_bg, fallback_hl)
local hex = fallback_hl or "#000000"
local hlexists = pcall(vim.api.nvim_get_hl, 0, { name = hl_group, link = false })
if hlexists then
local result = vim.api.nvim_get_hl(0, { name = hl_group, link = false })
if use_bg then
hex = result.bg and string.format("#%06x", result.bg) or "NONE"
else
hex = result.fg and string.format("#%06x", result.fg) or "NONE"
end
end
return hex
end Error in decoration provider treesitter/highlighter.line:
Error executing lua: ....local/share/nvim/site/lazy/neodim/lua/neodim/colors.lua:8: hex_to_rgb: invalid hex_str: none
stack traceback:
[C]: in function 'assert'
....local/share/nvim/site/lazy/neodim/lua/neodim/colors.lua:8: in function 'hex_to_rgb'
....local/share/nvim/site/lazy/neodim/lua/neodim/colors.lua:25: in function 'blend'
...l/share/nvim/site/lazy/neodim/lua/neodim/ts_override.lua:116: in function 'get_dim_color'
...l/share/nvim/site/lazy/neodim/lua/neodim/ts_override.lua:188: in function 'fn'
....1/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:213: in function 'for_each_highlight_state'
...l/share/nvim/site/lazy/neodim/lua/neodim/ts_override.lua:131: in function 'on_line_impl'
...l/share/nvim/site/lazy/neodim/lua/neodim/ts_override.lua:51: in function <...l/share/nvim/site/lazy/neodim/lua/neod
im/ts_override.lua:45> ui["sainnhe/gruvbox-material"] = {
lazy = false,
priority = 1000,
config = require("user.configs.ui.gruvbox"),
}
return function()
vim.o.background = "dark" -- or "light" for light mode
vim.cmd("let g:gruvbox_material_background= 'medium'")
vim.g.gruvbox_material_foreground = "material" -- original, mix, material
vim.cmd("let g:gruvbox_material_transparent_background=2")
vim.cmd("let g:gruvbox_material_diagnostic_line_highlight=1")
vim.cmd("let g:gruvbox_material_diagnostic_virtual_text='colored'")
vim.cmd("let g:gruvbox_material_enable_bold=1")
vim.cmd("let g:gruvbox_material_enable_italic=1")
-- changing bg and border colors
vim.api.nvim_set_hl(0, "FloatBorder", { link = "Normal" })
vim.api.nvim_set_hl(0, "LspInfoBorder", { link = "Normal" })
vim.api.nvim_set_hl(0, "NormalFloat", { link = "Normal" })
require("modules.utils").load_plugin("gruvbox-material", nil, true)
end When I open a .sh file and press a key like g to let neovim use the plugin to highlight, an error will occur. Now I have changed it to a fixed value and there is no error |
Beta Was this translation helpful? Give feedback.
Answered by
Jint-lzxy
Oct 27, 2024
Replies: 1 comment 5 replies
-
some hl_groups are not defined in gruvbox-material. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#1361 should take care of this issue 🥳