fix(config): skip deprecation warning when integrations key is present

Problem: `migrate_integrations` warned about old top-level keys even
when the user had already adopted `integrations`, which would be noisy
for configs that happen to have both.

Solution: only emit `vim.deprecate` and migrate values when
`opts.integrations` was not explicitly provided. When it is, old
top-level keys are silently stripped.
This commit is contained in:
Barrett Ruth 2026-03-06 14:33:51 -05:00
parent 1b4d933148
commit 244cae33bd
Signed by: barrett
GPG key ID: A6C96C9349D2FC81

View file

@ -604,16 +604,17 @@ end
local integration_keys = { 'fugitive', 'neogit', 'gitsigns', 'committia', 'telescope' }
local function migrate_integrations(opts)
local has_new = opts.integrations ~= nil
opts.integrations = opts.integrations or {}
for _, key in ipairs(integration_keys) do
if opts[key] ~= nil then
if not has_new then
vim.deprecate(
'vim.g.diffs.' .. key,
'vim.g.diffs.integrations.' .. key,
'0.3.2',
'diffs.nvim'
)
if opts.integrations[key] == nil then
opts.integrations[key] = opts[key]
end
opts[key] = nil