From 7b6ddbfc137ad5d8b178a3bbf5a1338630f30625 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 23 Jun 2024 22:15:10 +0200 Subject: [PATCH] fix(pkg): automatically update pkgs when editing a pkg file --- lua/lazy/core/config.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index 1b5d734..a7ac3c8 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -318,9 +318,13 @@ function M.setup(opts) -- useful for plugin developers when making changes to a packspec file vim.api.nvim_create_autocmd("BufWritePost", { - pattern = "lazy.lua", + pattern = { "lazy.lua", "pkg.json", "*.rockspec" }, callback = function() - require("lazy.view.commands").cmd("pkg") + require("lazy").pkg({ + plugins = { + require("lazy.core.plugin").find(vim.uv.cwd() .. "/lua/"), + }, + }) end, }) end,