mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-28 11:40:13 +02:00
style(config): added tracking for colorscheme
This commit is contained in:
parent
2c658a374d
commit
2abb5907ef
1 changed files with 7 additions and 5 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
local Util = require("lazy.core.util")
|
||||||
|
|
||||||
---@class LazyVimConfig: LazyVimOptions
|
---@class LazyVimConfig: LazyVimOptions
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
@ -160,7 +162,8 @@ function M.setup(opts)
|
||||||
M.lazy_file()
|
M.lazy_file()
|
||||||
end
|
end
|
||||||
|
|
||||||
require("lazy.core.util").try(function()
|
Util.track("colorscheme")
|
||||||
|
Util.try(function()
|
||||||
if type(M.colorscheme) == "function" then
|
if type(M.colorscheme) == "function" then
|
||||||
M.colorscheme()
|
M.colorscheme()
|
||||||
else
|
else
|
||||||
|
@ -169,10 +172,11 @@ function M.setup(opts)
|
||||||
end, {
|
end, {
|
||||||
msg = "Could not load your colorscheme",
|
msg = "Could not load your colorscheme",
|
||||||
on_error = function(msg)
|
on_error = function(msg)
|
||||||
require("lazy.core.util").error(msg)
|
Util.error(msg)
|
||||||
vim.cmd.colorscheme("habamax")
|
vim.cmd.colorscheme("habamax")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
Util.track()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Properly load file based plugins without blocking the UI
|
-- Properly load file based plugins without blocking the UI
|
||||||
|
@ -184,7 +188,6 @@ function M.lazy_file()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local Event = require("lazy.core.handler.event")
|
local Event = require("lazy.core.handler.event")
|
||||||
local Util = require("lazy.core.util")
|
|
||||||
vim.api.nvim_del_augroup_by_name("lazy_file")
|
vim.api.nvim_del_augroup_by_name("lazy_file")
|
||||||
|
|
||||||
Util.track({ event = "LazyVim.lazy_file" })
|
Util.track({ event = "LazyVim.lazy_file" })
|
||||||
|
@ -236,7 +239,6 @@ end
|
||||||
|
|
||||||
---@param name "autocmds" | "options" | "keymaps"
|
---@param name "autocmds" | "options" | "keymaps"
|
||||||
function M.load(name)
|
function M.load(name)
|
||||||
local Util = require("lazy.core.util")
|
|
||||||
local function _load(mod)
|
local function _load(mod)
|
||||||
Util.try(function()
|
Util.try(function()
|
||||||
require(mod)
|
require(mod)
|
||||||
|
@ -290,7 +292,7 @@ function M.init()
|
||||||
Plugin.Spec.add = function(self, plugin, ...)
|
Plugin.Spec.add = function(self, plugin, ...)
|
||||||
if type(plugin) == "table" then
|
if type(plugin) == "table" then
|
||||||
if M.renames[plugin[1]] then
|
if M.renames[plugin[1]] then
|
||||||
require("lazy.core.util").warn(
|
Util.warn(
|
||||||
("Plugin `%s` was renamed to `%s`.\nPlease update your config for `%s`"):format(
|
("Plugin `%s` was renamed to `%s`.\nPlease update your config for `%s`"):format(
|
||||||
plugin[1],
|
plugin[1],
|
||||||
M.renames[plugin[1]],
|
M.renames[plugin[1]],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue