Skip to content

Commit e619a6b

Browse files
slowsagemehalter
authored andcommitted
feat: add AstroUpdateCompleted event after Mason tools update
1 parent 269484c commit e619a6b

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

lua/astrocore/init.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ end
2727
--- Sync Lazy and then update Mason
2828
function M.update_packages()
2929
require("lazy").sync { wait = true }
30-
if vim.fn.exists ":MasonToolsUpdate" > 0 then vim.cmd.MasonToolsUpdate() end
30+
if vim.fn.exists ":MasonToolsUpdate" > 0 then
31+
vim.api.nvim_create_autocmd("User", {
32+
pattern = "MasonToolsUpdateCompleted",
33+
once = true,
34+
callback = function() M.event("UpdateCompleted", true) end,
35+
})
36+
vim.cmd.MasonToolsUpdate()
37+
else
38+
M.event("UpdateCompleted", true)
39+
end
3140
end
3241

3342
--- Partially reload AstroNvim user settings. Includes core vim options, mappings, and highlights. This is an experimental feature and may lead to instabilities until restart.

0 commit comments

Comments
 (0)