From 1e185330cad9ccbee7382cfb3e23b190c685bca4 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Feb 2026 20:47:36 -0500 Subject: [PATCH] fix: add deprecated setup() for backward compatibility Restores setup() with deprecation warning via vim.deprecate(). Users can continue using setup() while migrating to vim.g.http_codes. --- lua/http-codes.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/http-codes.lua b/lua/http-codes.lua index 47c17c2..0a10c8f 100644 --- a/lua/http-codes.lua +++ b/lua/http-codes.lua @@ -68,4 +68,15 @@ end M.http_codes = M.pick +---@deprecated Use `vim.g.http_codes` instead +function M.setup(user_config) + vim.deprecate('require("http-codes").setup()', 'vim.g.http_codes', '2.0.0', 'http-codes.nvim') + + if user_config then + vim.g.http_codes = vim.tbl_deep_extend('force', vim.g.http_codes or {}, user_config) + end + + init() +end + return M