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.
This commit is contained in:
Barrett Ruth 2026-02-03 20:47:36 -05:00
parent 7586374e68
commit 1e185330ca

View file

@ -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