From cfbc03a9549017984a2ca9c139553aac1c016a42 Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Sat, 4 Oct 2025 16:13:39 +0300 Subject: feat(pack)!: make `update()` include not active plugins by default Problem: Running `update()` by default doesn't include not active plugins, because there was no way to get relevant `version` to get updates from. This might be a problem in presence of lazy loaded plugins, i.e. ones that can be "not *yet* active" but still needed to be updated. Solution: Include not active plugins by default since their `version` is tracked via lockfile. --- runtime/lua/vim/pack.lua | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'runtime/lua/vim/pack.lua') diff --git a/runtime/lua/vim/pack.lua b/runtime/lua/vim/pack.lua index fe68bb3a02..268f43e063 100644 --- a/runtime/lua/vim/pack.lua +++ b/runtime/lua/vim/pack.lua @@ -401,15 +401,8 @@ local function plug_list_from_names(names) local plug_dir = get_plug_dir() local plugs = {} --- @type vim.pack.Plug[] for _, p_data in ipairs(p_data_list) do - -- NOTE: By default include only active plugins (and not all on disk). Using - -- not active plugins might lead to a confusion as default `version` and - -- user's desired one might mismatch. - -- TODO(echasnovski): Change this when there is lockfile. - if names ~= nil or p_data.active then - plugs[#plugs + 1] = new_plug(p_data.spec, plug_dir) - end + plugs[#plugs + 1] = new_plug(p_data.spec, plug_dir) end - return plugs end @@ -975,7 +968,7 @@ end --- --- @param names? string[] List of plugin names to update. Must be managed --- by |vim.pack|, not necessarily already added to current session. ---- Default: names of all plugins added to current session via |vim.pack.add()|. +--- Default: names of all plugins managed by |vim.pack|. --- @param opts? vim.pack.keyset.update function M.update(names, opts) vim.validate('names', names, vim.islist, true, 'list') -- cgit