diff --git a/lua/packer.lua b/lua/packer.lua index 65a2604..5e09b04 100644 --- a/lua/packer.lua +++ b/lua/packer.lua @@ -21,9 +21,11 @@ for name, _ in vim.fs.dir(config_module_path) do end vim.api.nvim_create_user_command('UpdatePacks', function () - vim.iter(vim.pack.get()) - :filter(function(x) return not x.active end) - :map(function(x) return x.spec.name end) - :totable() + local delete_candidates = vim.iter(vim.pack.get()) + :filter(function(x) return not x.active end) + :map(function(x) return x.spec.name end) + :totable() + + vim.pack.del(delete_candidates) vim.pack.update() end, {})