bug: certain highlight groups don't update with custom color config
Did you check docs and existing issues?
- [x] I have read all the tokyonight.nvim docs
- [x] I have updated the plugin to the latest version before submitting this issue
- [x] I have searched the existing issues of tokyonight.nvim
- [x] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
NVIM v0.11.3
Operating system/version
NVIM v0.11.3
Describe the bug
I'm overwriting theme colors via the on_colors function as described in the docs and it works for pretty much everything, except markdown headers. Even tho if i change those colors inside of the plugin itself (tokyonight.nvim/lua/tokyonight/colors/storm.lua), it works just fine.
EDIT: i forgot about it since it's been a while but this also applies to Diff highlights, Diagnostic highlights (virtual text too), @comment highlights and a few other things
I know you can change these highlight groups directly via the on_highlights function but it's more tedious and imo they should follow the custom colors.
Heading 1 uses the same color as the table column titles as well as todo item brackets
Changing colors via config doesn't affect the header
Changing colors directly in the plugin file DOES affect the header
Steps To Reproduce
- Open a markdown file
- Highlight colors use the default theme instead of an overwrite
Expected Behavior
Changing colors via config works the same way as changing them in the plugin itself.
Apologies if that's somehow not an expected behavior but i failed to find any discussion on this topic.
Repro
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
local languages = { "markdown" }
require("lazy.minit").repro({
spec = {
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
config = function()
require("tokyonight").setup({
cache = false,
on_colors = function(cl)
cl.blue = "#fe0000"
end,
})
vim.cmd.colorscheme("tokyonight-storm")
end,
},
{
"nvim-treesitter/nvim-treesitter",
lazy = false,
branch = "main",
build = ":TSUpdate",
config = function()
require("nvim-treesitter").install(languages)
vim.api.nvim_create_autocmd("FileType", {
pattern = require("nvim-treesitter").get_installed(),
callback = function()
vim.treesitter.start()
end,
})
end,
},
},
})
NOTE: Setting some colors to none in the plugin file breaks the theme due to an error:
/home/noby/.config/nvim/lua/plugins/colors.lua:187: Vim:E5113: Error while calling lua chunk: .../share/nvim/lazy/tokyonight.nvim/lua/tokyonight/util.lua:36: attempt to perform arithmetic on a nil value
stack traceback:
.../share/nvim/lazy/tokyonight.nvim/lua/tokyonight/util.lua:36: in function 'blendChannel'
.../share/nvim/lazy/tokyonight.nvim/lua/tokyonight/util.lua:40: in function 'blend_bg'
...nvim/lazy/tokyonight.nvim/lua/tokyonight/colors/init.lua:33: in function 'setup'
...share/nvim/lazy/tokyonight.nvim/lua/tokyonight/theme.lua:7: in function 'load'
...re/nvim/lazy/tokyonight.nvim/colors/tokyonight-storm.lua:1: in main chunk
[C]: in function 'colorscheme'
/home/noby/.config/nvim/lua/plugins/colors.lua:187: in function 'config'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:380: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:378>
[C]: in function 'xpcall'
.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:135: in function 'try'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:395: in function 'config'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:362: in function '_load'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:197: in function 'load'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:127: in function 'startup'
.../noby/.local/share/nvim/lazy/lazy.nvim/lua/lazy/init.lua:112: in function 'setup'
/home/noby/.config/nvim/init.lua:4: in main chunk
(this is NOT an issue with the plugin config, this is me changing the default colors inside of the plugin itself. Not a real problem rn but wanted to note it just in case)