Skip to content

Commit 29de5e6

Browse files
committed
fix: ZDelete! includes zpack.nvim in deletion list
Append zpack.nvim at the end of the delete list so it gets deleted last, after all other plugins in reverse priority order.
1 parent 141fb23 commit 29de5e6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lua/zpack/commands.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ M.setup = function(prefix)
224224
for i = #state.registered_plugins, 1, -1 do
225225
table.insert(names, state.registered_plugins[i].name)
226226
end
227+
table.insert(names, 'zpack.nvim')
227228

228229
util.schedule_notify(("Deleting all %d installed plugin(s)..."):format(#names), vim.log.levels.INFO)
229230
vim.pack.del(names, { force = true })

tests/zdelete_test.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ return function()
4949
local call = _G.test_state.vim_pack_del_calls[1]
5050
helpers.assert_not_nil(call.opts, "opts should be passed to vim.pack.del")
5151
helpers.assert_true(call.opts.force, "force option should be true")
52-
helpers.assert_equal(#call.names, 3, "all 3 plugins should be in delete list")
52+
helpers.assert_equal(#call.names, 4, "all 4 plugins (3 + zpack.nvim) should be in delete list")
53+
helpers.assert_table_contains(call.names, 'zpack.nvim', "zpack.nvim should be in delete list")
5354

5455
helpers.cleanup_test_env()
5556
helpers.delete_zpack_commands()

0 commit comments

Comments
 (0)