mirror of https://github.com/folke/lazy.nvim.git
perf(util): execute VeryLazy right after UIEnter
This commit is contained in:
parent
8756c0950c
commit
5aca9280df
|
@ -141,10 +141,10 @@ end
|
||||||
|
|
||||||
function M.very_lazy()
|
function M.very_lazy()
|
||||||
local function _load()
|
local function _load()
|
||||||
vim.defer_fn(function()
|
vim.schedule(function()
|
||||||
vim.g.did_very_lazy = true
|
vim.g.did_very_lazy = true
|
||||||
vim.cmd("do User VeryLazy")
|
vim.cmd("do User VeryLazy")
|
||||||
end, 50)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
@ -154,7 +154,7 @@ function M.very_lazy()
|
||||||
if vim.v.vim_did_enter == 1 then
|
if vim.v.vim_did_enter == 1 then
|
||||||
_load()
|
_load()
|
||||||
else
|
else
|
||||||
vim.api.nvim_create_autocmd("VimEnter", {
|
vim.api.nvim_create_autocmd("UIEnter", {
|
||||||
once = true,
|
once = true,
|
||||||
callback = function()
|
callback = function()
|
||||||
_load()
|
_load()
|
||||||
|
|
Loading…
Reference in New Issue