Closed tan-wei closed 8 months ago
Using this minimal init.lua, I can't reproduce the problem. Can you check if anything in your config might conflict?
The hook for scope highlight from extmark changed in #802, but I can't immediately see what could make the new one fail if the old one works.
local lazypath = "/tmp/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system { "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }
end
vim.opt.rtp:prepend(lazypath)
vim.opt.termguicolors = true
require("lazy").setup ({
{
"hiphish/rainbow-delimiters.nvim"
},
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
config = function()
local highlight = {
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
}
local hooks = require "ibl.hooks"
-- create the highlight groups in the highlight setup hook, so they are reset
-- every time the colorscheme changes
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
end)
vim.g.rainbow_delimiters = { highlight = highlight }
require("ibl").setup { scope = { highlight = highlight } }
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
end
},
-- uncomment this if the problem is related to scope
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup {
ensure_installed = { "rust" }, -- change this to the language you use
}
end,
},
}, { root = "/tmp/lazy" })
Hmm. With the minimal init.lua, I can't reproduce the problem, either.
So it must be my own problem in my configuration. I'll try to find the confilict.
I think I find the method how to make it work. Both of them should be applied at the same time:
event = "VeryLazy"
to make it lazy load (update: Changed it into BufEnter
just the same with rainbow-delimiters.nvim
is OK, does it mean rainbow-delimiters.nvim
may conflict with ibl
?)vim.g.rainbow_delimiters
like the minimal init.lua in config
file. Before changed, I set it in init
function, which is set before config
function is calledBut I can't find why these steps work.
The issue should be closed. Thanks @lukas-reineke .
If you lazy load ibl after rainbow delimiters, and you create the highlight groups inside the ibl setup, rainbow delimiters will not have any highlighting set when it initializes. It falls back to the default, and the highlights won't match that of ibl.
You need to either, create the highlight groups first, before you load any plugins, or keep it as you have now, but load rainbow delimiters after ibl.
Got it. Lazy load could cause some issues like this. Thanks for your reply.
Problem
rainbow-delimiters.nvim integration is broken since 3.4.0, and I can confirm it is OK with 3.3.12 and before.
Since 3.4.0, the color for indent line is always the first color instead of rainbow colors.
Steps to reproduce
Use example configuration in Readme.md:
For version 3.3.11 (and before), the rainbow indent line would be:
![3 3 11-3](https://github.com/lukas-reineke/indent-blankline.nvim/assets/28227509/18905e0e-3301-422c-aef5-f9bfe8edbde3)
But since 3.4.0, it becomes (the pictures are using ibl 3.4.2):
![3 4 2-3](https://github.com/lukas-reineke/indent-blankline.nvim/assets/28227509/aee274be-d0cf-4008-948a-8db7e86d4614)
Expected behavior
Works as version before 3.4.0.
Neovim version (nvim -v)
v0.10.0-dev-1947+gab2aad509d6