Description
DiffviewDiffAddAsDelete misses {default = true} attr, so on ColorScheme autocmd Diffview overrides custom setup.
Expected behavior
Diffview respects existing value.
Actual behavior
Diffview rederives hl group from DiffDelete. If DiffDelete is setup to be dim globally (so that manual diffthis would look nicer), this affects DiffAdd with enhanced_diff_hl enabled.
Steps to reproduce
- git init
- printf 'a1\na2\n' > ./a.txt
- git add a.txt
- git commit -m 'a.txt'
- printf 'a2\n' > ./a.txt
- nvim --clean -u mini.lua
- :DiffviewOpen
-- diffthis looks pretty
8. printf 'a1\na2\n' > ./b.txt
9.
:e a.txt
:vsplit b.txt
:windo diffthis
Health check
Output of :checkhealth diffview
==============================================================================
diffview: 1 ⚠️
Checking plugin dependencies ~
- ✅ OK nvim-web-devicons installed.
Checking VCS tools ~
- The plugin requires at least one of the supported VCS tools to be valid.
- ✅ OK Git found.
- ✅ OK Git is up-to-date. (2.50.1)
- ⚠️ WARNING Configured `hg_cmd` is not executable: 'hg'
Log info
No response
Neovim version
NVIM v0.12.5
Build type: Release
LuaJIT 2.1.1787165859
Operating system and version
Darwin 25.6.0 arm64
Minimal config
-- #######################################
-- ### USAGE: nvim --clean -u mini.lua ###
-- #######################################
local root = vim.fn.stdpath("run") .. "/nvim/diffview.nvim"
local plugin_dir = root .. "/plugins"
vim.fn.mkdir(plugin_dir, "p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
local plugins = {
{ "nvim-web-devicons", url = "https://github.com/nvim-tree/nvim-web-devicons.git" },
{ "diffview.nvim", url = "https://github.com/sindrets/diffview.nvim.git" },
{ "catppuccin", url = "https://github.com/catppuccin/nvim" }
}
for _, spec in ipairs(plugins) do
local install_path = plugin_dir .. "/" .. spec[1]
if vim.fn.isdirectory(install_path) ~= 1 then
if spec.url then
print(string.format("Installing '%s'...", spec[1]))
vim.fn.system({ "git", "clone", "--depth=1", spec.url, install_path })
end
end
vim.opt.runtimepath:append(spec.path or install_path)
end
require("catppuccin").setup({
highlight_overrides = {
all = function(colors)
local U = require "catppuccin.utils.colors"
return {
DiffviewDiffAddAsDelete = {
bg = U.darken(colors.red, 0.18, colors.base),
},
DiffDelete = {
bg = "NONE",
fg = colors.surface1,
},
}
end,
},
})
require("diffview").setup({
enhanced_diff_hl = true,
})
vim.opt.termguicolors = true
vim.cmd("colorscheme catppuccin-macchiato")
print("Ready!")
Description
DiffviewDiffAddAsDelete misses
{default = true}attr, so onColorSchemeautocmd Diffview overrides custom setup.Expected behavior
Diffview respects existing value.
Actual behavior
Diffview rederives hl group from
DiffDelete. IfDiffDeleteis setup to be dim globally (so that manual diffthis would look nicer), this affectsDiffAddwithenhanced_diff_hlenabled.Steps to reproduce
-- diffthis looks pretty
8. printf 'a1\na2\n' > ./b.txt
9.
:e a.txt
:vsplit b.txt
:windo diffthis
Health check
Output of
:checkhealth diffviewLog info
No response
Neovim version
Operating system and version
Darwin 25.6.0 arm64
Minimal config