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

No highlighting on git diffs on theme dracula on neovim #75

Open
eduardoarandah opened this issue Feb 27, 2023 · 5 comments
Open

No highlighting on git diffs on theme dracula on neovim #75

eduardoarandah opened this issue Feb 27, 2023 · 5 comments

Comments

@eduardoarandah
Copy link

eduardoarandah commented Feb 27, 2023

Plugin: fugitive
Command: Gdiffsplit HEAD~1
Plugin manager: lazy

Expecting: diff hightlighting

image

When changing to built-in theme slate it works

:colorscheme slate

image

Tried: loading theme first by setting priority in lazy as in the example

https://github.com/folke/lazy.nvim#examples

	{
		"Mofiqul/dracula.nvim",
		lazy = false, -- make sure we load this during startup if it is your main colorscheme
		priority = 1000, -- make sure to load this before all the other start plugins
		config = function()
			vim.g.rehash256 = 1
			vim.api.nvim_cmd({
				cmd = "colorscheme",
				args = { "dracula" },
			}, {})
		end,
	},

However... when I delete a block in my working copy, then hightlighting works.

image

Kind of solved:

I manually added this and it worked:

highlight DiffChange cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=gray
highlight DiffText   cterm=bold ctermfg=10 ctermbg=88 gui=none guifg=bg guibg=orange

image

@lucasrabiec
Copy link

lucasrabiec commented Mar 1, 2023

Diffview also has no highlighting for changed code (added/deleted has green/red background). It works well in Tokyonight theme. It uses darken method: https://github.com/folke/tokyonight.nvim/blob/735e94f3b36ae8b0caa30d1806eb2fa1c3619ca6/lua/tokyonight/colors.lua#LL119C8-L119C8
It highlights only the background with a darker color. Code has still all of its colors.

@lucasrabiec
Copy link

I added the necessary overrides to make it look better:

overrides = {
  DiffAdd = { bg = darken(colors.bright_green, 0.15) },
  DiffDelete = { fg = colors.bright_red },
  DiffChange = { bg = darken(colors.comment, 0.15) },
  DiffText = { bg = darken(colors.comment, 0.50) },
  illuminatedWord = { bg = darken(colors.comment, 0.65) },
  illuminatedCurWord = { bg = darken(colors.comment, 0.65) },
  IlluminatedWordText = { bg = darken(colors.comment, 0.65) },
  IlluminatedWordRead = { bg = darken(colors.comment, 0.65) },
  IlluminatedWordWrite = { bg = darken(colors.comment, 0.65) },
},

I copied darken methods and other needed helpers from Tokyonight.

Illuminate also needs to be overwritten because dracula.nvim doesn't color it by default.

@Mofiqul
Copy link
Owner

Mofiqul commented Mar 2, 2023

I will implement it this weekend

@Drowze
Copy link
Contributor

Drowze commented Oct 5, 2023

Looking forward to this change :) meanwhile using @lucasrabiec override configuration.

@and-rose
Copy link

and-rose commented May 7, 2024

Would also love to see this change :D

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

5 participants