feat: use LazyVim everywhere instead of require("lazyvim.util")

This commit is contained in:
Folke Lemaitre 2024-03-22 09:15:09 +01:00
parent 3a87c08cda
commit 7a5dbeae75
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
41 changed files with 188 additions and 229 deletions

View file

@ -1,5 +1,4 @@
local Config = require("lazyvim.config")
local Util = require("lazyvim.util")
---@class lazyvim.util.news
local M = {}
@ -27,7 +26,7 @@ function M.setup()
end
function M.welcome()
Util.info("Welcome to LazyVim!")
LazyVim.info("Welcome to LazyVim!")
end
function M.changelog()
@ -50,7 +49,7 @@ function M.open(file, opts)
if opts.plugin then
local plugin = require("lazy.core.config").plugins[opts.plugin] --[[@as LazyPlugin?]]
if not plugin then
return Util.error("plugin not found: " .. opts.plugin)
return LazyVim.error("plugin not found: " .. opts.plugin)
end
file = plugin.dir .. "/" .. file
elseif opts.rtp then
@ -58,7 +57,7 @@ function M.open(file, opts)
end
if not file then
return Util.error("File not found")
return LazyVim.error("File not found")
end
if opts.when_changed then
@ -68,7 +67,7 @@ function M.open(file, opts)
return
end
Config.json.data.news[ref] = hash
Util.json.save()
LazyVim.json.save()
-- don't open if file has never been opened
if is_new then
return