Skip to content

Commit

Permalink
perf(util): execute VeryLazy right after UIEnter
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 11, 2023
1 parent 8756c09 commit 5aca928
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/lazy/core/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand All @@ -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()
Expand Down

0 comments on commit 5aca928

Please sign in to comment.