Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treesitter highlight messes up colors in imports #371

Open
elvisbejko opened this issue Dec 21, 2024 · 0 comments
Open

Treesitter highlight messes up colors in imports #371

elvisbejko opened this issue Dec 21, 2024 · 0 comments

Comments

@elvisbejko
Copy link

elvisbejko commented Dec 21, 2024

The treesitter highlight doesn't integrate well with python.

I get the imports all highlighted with the same color (reddish):
{D0018636-4D9B-4C76-ADA6-B557F79CB54F}

Looking at similar code here on github, the expected look should be something like:
{725D1309-B267-48F6-8B9F-CEF73ED19C5A}

My github-nvim-theme configuration .lua and treesitter.lua follow:
treesitter.lua

return {
	"nvim-treesitter/nvim-treesitter",
	build = ":TSUpdate",
	config = function()
		local config = require("nvim-treesitter.configs")
		config.setup({
			auto_install = true,
			ensure_installed = { "lua", "c", "python", "rust", "latex" },
			highlight = { enable = true },
			indent = { enable = true },
		})
	end,
}

github-nvim-theme.lua

return {
	"projekt0n/github-nvim-theme",
	lazy = false,
	priority = 1000,
	config = function()
		require("github-theme").setup({
			groups = {
				all = {
					Normal = { bg = "NONE" },
					NormalNC = { bg = "NONE" },
					NetrwTreeBar = { bg = "NONE" }, -- Transparent background for netrw sidebar
					NetrwDir = { bg = "NONE" }, -- Transparent background for directories in netrw
					ColorColumn = { bg = "#1d1d1d" },
				},
			},
		})
		vim.cmd("colorscheme github_dark")
		vim.o.cursorline = true
		vim.api.nvim_set_hl(0, "CursorLineNr", { fg = "#FFF9D6", bold = true })
		vim.cmd("hi clear cursorline")
	end,
}

Since I recently bumped to a higher nvim version, I checked with earlier versions <0.10.x & the issue still persists.
Removing the highlight from treesitter.lua reverts the style to something too simplistic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant