-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
Diff view is missing syntax highlighting #105
Comments
agree this should be implemented 👍🏿 |
hey @ojurkiewicz thanks for the issue! I will be checking the highlights used in that plugin and see how can we improve this one. |
hey @ojurkiewicz i just pushed a new breaking change, and in the diffview tests i could see on my side that the colors were correct. Can you please pull latest, read the new README and check if it's working properly please? |
I've updated all plugins with Packer, restarted Neovim and it does not seem to make any difference Edit: Seems like you've asked about versions and config but removed. I'll answer anyway. Neovim 0.7. I've minimized config to what you can see below and I don't see any additional highlighting. local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.fn.execute('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path)
end
vim.api.nvim_exec(
[[
augroup Packer
autocmd!
autocmd BufWritePost init.lua PackerCompile
augroup end
]],
false
)
local use = require('packer').use
require('packer').startup(function()
use 'ellisonleao/gruvbox.nvim'
use { 'sindrets/diffview.nvim', requires = 'nvim-lua/plenary.nvim' }
end)
--Set colorscheme (order is important here)
vim.o.termguicolors = true
vim.o.background = "dark" -- or "light" for light mode
vim.cmd([[colorscheme gruvbox]])
vim.cmd([[highlight normal guibg=#000000]])
-- Diffview config
local cb = require'diffview.config'.diffview_callback
require('diffview').setup() |
I've checked the original plugins and it seems this is a problem in the original version as well. Unfortunately, I don't have an immediate solution for this because that will require changing the main colors for the require('gruvbox').setup({
overrides = {
DiffChange = {bg="#rgbcolor", fg="#rgbcolor", ...},
DiffAdd = {bg="#rgbcolor", fg="#rgbcolor", ...},
DiffDelete = {bg="#rgbcolor", fg="#rgbcolor", ...},
DiffText = {bg="#rgbcolor", fg="#rgbcolor", ...},
}
})
vim.cmd([[colorscheme gruvbox]]) |
I've faced up with same issue... |
I tried overriding the gruvbox Diff highlights with the I created a new file in local colors = require("gruvbox.palette").colors;
function FixGruvbox()
vim.api.nvim_set_hl(0, 'DiffviewDiffAddAsDelete', { bg = "#431313" })
vim.api.nvim_set_hl(0, 'DiffDelete', { bg = "none", fg = colors.dark2 })
vim.api.nvim_set_hl(0, 'DiffviewDiffDelete', { bg = "none", fg = colors.dark2 })
vim.api.nvim_set_hl(0, 'DiffAdd', { bg = "#142a03" })
vim.api.nvim_set_hl(0, 'DiffChange', { bg = "#3B3307" })
vim.api.nvim_set_hl(0, 'DiffText', { bg = "#4D520D" })
end
FixGruvbox()
vim.api.nvim_create_autocmd(
"ColorScheme",
{ pattern = { "gruvbox" }, callback = FixGruvbox }
) These colors were picked by me based on what I think looked nice and was gruvbox-y enough (all existing palette colors were too bright to use as background colors). I have also overrode my background color to be darker ( The autocmd ensures the fix is applied again after switching to a different theme with the Note the |
@thallada cool! |
Hey, just as the title and attached screenshot show. I am using the "sindrets/diffview.nvim" plugin and reviewing changes is currently very unreadable in my opinion. An example of how it might look below. I have no experience with configuring colorschemes but if someone would like to guide me which properties are responsible for this diffview I can try to fix it and open a PR. If there is no desire to change it in this project, I will at least overwrite it in my private init.lua, so any help is welcome.
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered: