From bfe8ee9cba642525a5bbbe0b27f6049ba9ee1ef4 Mon Sep 17 00:00:00 2001 From: LostNeophyte Date: Wed, 25 Jan 2023 20:35:07 +0100 Subject: fix: don't overriding user's config --- lua/lvim/config/_deprecated.lua | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'lua/lvim/config') diff --git a/lua/lvim/config/_deprecated.lua b/lua/lvim/config/_deprecated.lua index 5ce851c2..d2a86e9f 100644 --- a/lua/lvim/config/_deprecated.lua +++ b/lua/lvim/config/_deprecated.lua @@ -134,9 +134,26 @@ end M.post_builtin = { -- example: - -- which_key = function () - -- - -- end + cmp = function() + local builtin = "cmp" + local table = lvim.builtin[builtin] + local allowed_keys = { active = true, on_config = true, on_config_done = true, opts = true } + for key, value in pairs(table) do + if not allowed_keys[key] then + vim.schedule(function() + vim.notify( + string.format( + "`lvim.builtin.%s.%s` is deprecated, use `lvim.builtin.%s.opts.%s` instead", + builtin, + key, + builtin, + key + ) + ) + end) + end + end + end, } return M -- cgit v1.2.3