From 63264255cdb7d200de39d0aaf26939d084ba460e Mon Sep 17 00:00:00 2001
From: Barrett Ruth
Date: Sun, 8 Nov 2026 15:15:07 -0600
Subject: [PATCH 1/2] fix: migrate legacy highlight settings
---
lua/diffs/config.lua | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/lua/diffs/config.lua b/lua/diffs/config.lua
index 374d1e6..0ac2b6a 100644
--- a/lua/diffs/config.lua
+++ b/lua/diffs/config.lua
@@ -129,6 +129,7 @@ function M.validate(opts)
local types = key == 'treesitter' and 'table' or { 'boolean', 'table' }
vim.validate(path, value, types, true)
if type(value) == 'table' then
+ vim.validate(path .. '.enabled', value.enabled, 'boolean', true)
vim.validate(path .. '.max_lines', value.max_lines, 'number', true)
if value.max_lines and value.max_lines < 1 then
error('diffs: ' .. path .. '.max_lines must be >= 1')
@@ -190,7 +191,34 @@ function M.new(opts)
vim.log.levels.WARN
)
end
+ if opts.highlights and opts.highlights.context ~= nil then
+ vim.notify_once(
+ '[diffs]: highlights.context was removed and is ignored. Remove it from the configuration.',
+ vim.log.levels.WARN
+ )
+ end
local result = vim.tbl_deep_extend('force', DEFAULTS, opts)
+ for _, key in ipairs({ 'treesitter', 'vim', 'intra' }) do
+ local value = result.highlights[key]
+ if type(value) == 'table' and value.enabled ~= nil then
+ local migration = key == 'treesitter'
+ and 'The enabled field is ignored. Tree-sitter highlighting is always enabled. Remove enabled.'
+ or key == 'intra' and 'Remove enabled and use diffopt. See :help diffs.nvim-diffopt.'
+ or 'Use highlights.vim = false to disable Vim syntax. Otherwise remove enabled.'
+ vim.notify_once(
+ '[diffs]: highlights.'
+ .. key
+ .. '.enabled is deprecated. Support ends on November 30, 2026. '
+ .. migration,
+ vim.log.levels.WARN
+ )
+ if key ~= 'treesitter' and value.enabled == false then
+ result.highlights[key] = false
+ else
+ value.enabled = nil
+ end
+ end
+ end
if type(result.conflict) == 'table' and result.conflict.enabled ~= nil then
vim.notify_once(
'[diffs]: conflict.enabled is deprecated. Support ends on November 30, 2026. '
From d3def3ec78cdd22da433675b27746f7fd0cf00a5 Mon Sep 17 00:00:00 2001
From: Barrett Ruth
Date: Sun, 8 Nov 2026 15:15:51 -0600
Subject: [PATCH 2/2] refactor!: remove legacy highlight migration support
---
lua/diffs/config.lua | 29 +----------------------------
1 file changed, 1 insertion(+), 28 deletions(-)
diff --git a/lua/diffs/config.lua b/lua/diffs/config.lua
index 0ac2b6a..bfc43d6 100644
--- a/lua/diffs/config.lua
+++ b/lua/diffs/config.lua
@@ -129,7 +129,7 @@ function M.validate(opts)
local types = key == 'treesitter' and 'table' or { 'boolean', 'table' }
vim.validate(path, value, types, true)
if type(value) == 'table' then
- vim.validate(path .. '.enabled', value.enabled, 'boolean', true)
+ vim.validate(path .. '.enabled', value.enabled, 'nil')
vim.validate(path .. '.max_lines', value.max_lines, 'number', true)
if value.max_lines and value.max_lines < 1 then
error('diffs: ' .. path .. '.max_lines must be >= 1')
@@ -191,34 +191,7 @@ function M.new(opts)
vim.log.levels.WARN
)
end
- if opts.highlights and opts.highlights.context ~= nil then
- vim.notify_once(
- '[diffs]: highlights.context was removed and is ignored. Remove it from the configuration.',
- vim.log.levels.WARN
- )
- end
local result = vim.tbl_deep_extend('force', DEFAULTS, opts)
- for _, key in ipairs({ 'treesitter', 'vim', 'intra' }) do
- local value = result.highlights[key]
- if type(value) == 'table' and value.enabled ~= nil then
- local migration = key == 'treesitter'
- and 'The enabled field is ignored. Tree-sitter highlighting is always enabled. Remove enabled.'
- or key == 'intra' and 'Remove enabled and use diffopt. See :help diffs.nvim-diffopt.'
- or 'Use highlights.vim = false to disable Vim syntax. Otherwise remove enabled.'
- vim.notify_once(
- '[diffs]: highlights.'
- .. key
- .. '.enabled is deprecated. Support ends on November 30, 2026. '
- .. migration,
- vim.log.levels.WARN
- )
- if key ~= 'treesitter' and value.enabled == false then
- result.highlights[key] = false
- else
- value.enabled = nil
- end
- end
- end
if type(result.conflict) == 'table' and result.conflict.enabled ~= nil then
vim.notify_once(
'[diffs]: conflict.enabled is deprecated. Support ends on November 30, 2026. '