The onedarkpro theme has special treatment to indent highlight groups
function M.groups(theme)
return {
-- https://github.com/lukas-reineke/indent-blankline.nvim/blob/caf7f61e94525bbd97e32f118efd6c0722430616/doc/indent_blankline.txt#L31
IndentLine = { fg = theme.generated.indentline },
IndentBlanklineChar = { link = "IndentLine" },
IndentBlanklineSpaceChar = { link = "IndentLine" },
IndentBlanklineSpaceCharBlankline = { link = "IndentLine" },
IndentBlanklineContextChar = { fg = theme.palette.purple },
IndentBlanklineContextStart = { underline = true },
-- for Version 3.0
IblIndent = { link = "IndentLine" },
}
end
With this, my cursor looks like
When cursor is overlayed on top of the indent, the color is changed
I have read Issue #346. I think this is a bug, the cursor color (bg and fg) should be consistent whether or not
it's on the indent character (it's already consistent on other characters like whitespaces and keywords).
NOTE: I tried to comment out the line IblIndent = { link = "IndentLine" } in theme, clean and regenerate
onedarkpro colorscheme cache, reopen the file, then the bug is gone, see
I did some investigation with :Telescope highlights. It seems the bug is caused by linking iblIndent to the
IndentLine group in theme, remove the link and set colors for iblIndent directly then it's correct.
Steps to reproduce
indent-blankline config:
local api = vim.api
local exclude_ft = { "help", "git", "markdown", "snippets", "text", "gitconfig", "alpha", "dashboard" }
require("ibl").setup {
indent = {
-- -- U+2502 may also be a good choice, it will be on the middle of cursor.
-- -- U+250A is also a good choice
char = "▏",
-- char = "\u{2502}",
},
scope = {
enabled = false,
show_start = false,
show_end = false,
},
exclude = {
filetypes = exclude_ft,
buftypes = { "terminal" },
},
}
local gid = api.nvim_create_augroup("indent_blankline", { clear = true })
api.nvim_create_autocmd("InsertEnter", {
pattern = "*",
group = gid,
command = "IBLDisable",
})
api.nvim_create_autocmd("InsertLeave", {
pattern = "*",
group = gid,
callback = function()
if not vim.tbl_contains(exclude_ft, vim.bo.filetype) then
vim.cmd([[IBLEnable]])
end
end,
})
Like I said in #346, this is not an issue in indent-blankline. How your cursor looks depends on your terminal, and the cursor and color scheme in Neovim.
Problem
The onedarkpro theme has special treatment to indent highlight groups
With this, my cursor looks like When cursor is overlayed on top of the indent, the color is changed
I have read Issue #346. I think this is a bug, the cursor color (bg and fg) should be consistent whether or not it's on the indent character (it's already consistent on other characters like whitespaces and keywords).
NOTE: I tried to comment out the line
IblIndent = { link = "IndentLine" }
in theme, clean and regenerate onedarkpro colorscheme cache, reopen the file, then the bug is gone, seeI did some investigation with
:Telescope highlights
. It seems the bug is caused by linkingiblIndent
to theIndentLine
group in theme, remove the link and set colors foriblIndent
directly then it's correct.Steps to reproduce
indent-blankline config:
Cursor config:
Expected behavior
Expect the cursor to be displayed as set by
highlight Cursor ...
when on top of the indent.Neovim version (nvim -v)
NVIM v0.10.0-dev-2063+ga767c046f Build type: RelWithDebInfo LuaJIT 2.1.1703358377