mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 18:06:30 +00:00
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.
This commit is contained in:
@@ -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')
|
||||
|
Reference in New Issue
Block a user