perf(util): execute VeryLazy right after UIEnter

This commit is contained in:
Folke Lemaitre 2023-01-11 13:40:19 +01:00
parent 8756c0950c
commit 5aca9280df
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 3 deletions

View File

@ -141,10 +141,10 @@ end
function M.very_lazy()
local function _load()
vim.defer_fn(function()
vim.schedule(function()
vim.g.did_very_lazy = true
vim.cmd("do User VeryLazy")
end, 50)
end)
end
vim.api.nvim_create_autocmd("User", {
@ -154,7 +154,7 @@ function M.very_lazy()
if vim.v.vim_did_enter == 1 then
_load()
else
vim.api.nvim_create_autocmd("VimEnter", {
vim.api.nvim_create_autocmd("UIEnter", {
once = true,
callback = function()
_load()