Comments (6)
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.
from indent-blankline.nvim.
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" })
from indent-blankline.nvim.
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.
from indent-blankline.nvim.
I think I find the method how to make it work. Both of them should be applied at the same time:
- Disable lazy loading for ibl. Before changed, I use
event = "VeryLazy"
to make it lazy load (update: Changed it intoBufEnter
just the same withrainbow-delimiters.nvim
is OK, does it meanrainbow-delimiters.nvim
may conflict withibl
?) - set
vim.g.rainbow_delimiters
like the minimal init.lua inconfig
file. Before changed, I set it ininit
function, which is set beforeconfig
function is called
But I can't find why these steps work.
from indent-blankline.nvim.
The issue should be closed. Thanks @lukas-reineke .
from indent-blankline.nvim.
Got it. Lazy load could cause some issues like this. Thanks for your reply.
from indent-blankline.nvim.
Related Issues (20)
- Error on all files after upgrading to v3.5.0 HOT 4
- Attempt to perform arithmetic on a nil value HOT 5
- breakindent (vim.opt.breakindent) breaks indent-blankline since `9433822` HOT 3
- Does this work for vim? HOT 1
- Highlight leading whitespace with dots as in screenshots HOT 1
- incorrect highlight when type a bracket in the last line of a function HOT 2
- allow disabling first level of scope indent
- Disable lines on "Dashboard Nvim" plugin HOT 1
- Arabic text is concealed when indented HOT 7
- Indent highlight doesn't work HOT 4
- indentation breaks with breakindent set true HOT 2
- Error when opening DiffView HOT 2
- question: how to manage overlap background colors HOT 2
- Window-local Option for Indentation Guides in IBL HOT 1
- Error When Changing Background HOT 2
- Guides Not Showing Correctly HOT 5
- Cursor color weird behavior with onedarkpro theme + indent-blankline HOT 2
- slow call to `vim.split` HOT 2
- Change background color from your example HOT 5
- Unable to see underlines HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from indent-blankline.nvim.