Skip to content

bug: certain highlight groups don't update with custom color config #754

@noby-y

Description

@noby-y

Did you check docs and existing issues?

  • I have read all the tokyonight.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of tokyonight.nvim
  • 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

Image

Changing colors via config doesn't affect the header

Image Image

Changing colors directly in the plugin file DOES affect the header

Image Image

Steps To Reproduce

  1. Open a markdown file
  2. 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,
		},
	},
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions