From 9304c37515a5f6a090a6167ad05eac3bce879146 Mon Sep 17 00:00:00 2001 From: pynappo Date: Sun, 28 Jan 2024 13:25:40 -0800 Subject: [PATCH] hide `_` key of plugins --- lua/lazy/core/plugin.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index 374aca7..495af5e 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -341,6 +341,12 @@ function Spec:report(level) return count end +local remove_internal_keys = function(item, path) + if path[#path] == "_" then + return nil + end + return item +end ---@param spec LazySpec|LazySpecImport ---@param results? string[] function Spec:normalize(spec, results) @@ -371,8 +377,8 @@ function Spec:normalize(spec, results) spec["WARNING:"] = "-- Ignored keys below! --" self:warn( "This list of specs has extraneous keys - " - .. "these will not be processed by lazy.nvim as they do not belong to any plugins:\n" - .. vim.inspect(spec, { depth = 2, process = processor }) + .. "they do not belong to any plugins, so they are currently unused by lazy.nvim:\n" + .. vim.inspect(spec, { depth = 2, process = remove_internal_keys }) .. "\n" ) end