From 244cae33bd6ef2a981d391a63e6f1eb450bac1f4 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 6 Mar 2026 14:33:51 -0500 Subject: [PATCH] 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. --- lua/diffs/init.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lua/diffs/init.lua b/lua/diffs/init.lua index 6a97c00..ed47388 100644 --- a/lua/diffs/init.lua +++ b/lua/diffs/init.lua @@ -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 - vim.deprecate( - 'vim.g.diffs.' .. key, - 'vim.g.diffs.integrations.' .. key, - '0.3.2', - 'diffs.nvim' - ) - if opts.integrations[key] == nil then + if not has_new then + vim.deprecate( + 'vim.g.diffs.' .. key, + 'vim.g.diffs.integrations.' .. key, + '0.3.2', + 'diffs.nvim' + ) opts.integrations[key] = opts[key] end opts[key] = nil