perf(util): dont trigger VeryLazy autocmds when exiting

This commit is contained in:
Folke Lemaitre 2023-01-16 12:29:19 +01:00
parent 02482b1ec9
commit 1e67dc0d56
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 0 deletions

View File

@ -142,6 +142,9 @@ end
function M.very_lazy() function M.very_lazy()
local function _load() local function _load()
vim.schedule(function() vim.schedule(function()
if vim.v.exiting then
return
end
vim.g.did_very_lazy = true vim.g.did_very_lazy = true
vim.api.nvim_exec_autocmds("User", { pattern = "VeryLazy", modeline = false }) vim.api.nvim_exec_autocmds("User", { pattern = "VeryLazy", modeline = false })
end) end)