mirror of https://github.com/folke/lazy.nvim.git
fix(config): properly handle uis connecting after startup
This commit is contained in:
parent
457e65eec8
commit
5ed89b5a0d
|
@ -204,8 +204,10 @@ function M.setup(opts)
|
||||||
|
|
||||||
if M.headless() then
|
if M.headless() then
|
||||||
require("lazy.view.commands").setup()
|
require("lazy.view.commands").setup()
|
||||||
else
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("UIEnter", {
|
vim.api.nvim_create_autocmd("UIEnter", {
|
||||||
|
once = true,
|
||||||
callback = function()
|
callback = function()
|
||||||
require("lazy.stats").on_ui_enter()
|
require("lazy.stats").on_ui_enter()
|
||||||
end,
|
end,
|
||||||
|
@ -227,7 +229,6 @@ function M.setup(opts)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
|
||||||
|
|
||||||
Util.very_lazy()
|
Util.very_lazy()
|
||||||
end
|
end
|
||||||
|
|
|
@ -142,6 +142,7 @@ end
|
||||||
function M.very_lazy()
|
function M.very_lazy()
|
||||||
local function _load()
|
local function _load()
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
|
vim.g.did_very_lazy = true
|
||||||
vim.cmd("do User VeryLazy")
|
vim.cmd("do User VeryLazy")
|
||||||
end, 50)
|
end, 50)
|
||||||
end
|
end
|
||||||
|
|
|
@ -65,7 +65,7 @@ function M.report(notify)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if #lines > 0 and notify and Config.options.checker.notify then
|
if #lines > 0 and notify and Config.options.checker.notify and not Config.headless() then
|
||||||
table.insert(lines, 1, "# Plugin Updates")
|
table.insert(lines, 1, "# Plugin Updates")
|
||||||
Util.info(lines)
|
Util.info(lines)
|
||||||
end
|
end
|
||||||
|
|
|
@ -75,7 +75,7 @@ function M.check(start)
|
||||||
|
|
||||||
if not (start or #changes == 0) then
|
if not (start or #changes == 0) then
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
if Config.options.change_detection.notify then
|
if Config.options.change_detection.notify and not Config.headless() then
|
||||||
local lines = { "# Config Change Detected. Reloading...", "" }
|
local lines = { "# Config Change Detected. Reloading...", "" }
|
||||||
for _, change in ipairs(changes) do
|
for _, change in ipairs(changes) do
|
||||||
table.insert(lines, "- **" .. change.what .. "**: `" .. vim.fn.fnamemodify(change.file, ":p:~:.") .. "`")
|
table.insert(lines, "- **" .. change.what .. "**: `" .. vim.fn.fnamemodify(change.file, ":p:~:.") .. "`")
|
||||||
|
|
Loading…
Reference in New Issue