Skip to content

Commit 7b6ddbf

Browse files
committed
fix(pkg): automatically update pkgs when editing a pkg file
1 parent 3515cb5 commit 7b6ddbf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lua/lazy/core/config.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,13 @@ function M.setup(opts)
318318

319319
-- useful for plugin developers when making changes to a packspec file
320320
vim.api.nvim_create_autocmd("BufWritePost", {
321-
pattern = "lazy.lua",
321+
pattern = { "lazy.lua", "pkg.json", "*.rockspec" },
322322
callback = function()
323-
require("lazy.view.commands").cmd("pkg")
323+
require("lazy").pkg({
324+
plugins = {
325+
require("lazy.core.plugin").find(vim.uv.cwd() .. "/lua/"),
326+
},
327+
})
324328
end,
325329
})
326330
end,

0 commit comments

Comments
 (0)