mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-02 05:24:35 +02:00
feat: use LazyVim everywhere instead of require("lazyvim.util")
This commit is contained in:
parent
3a87c08cda
commit
7a5dbeae75
41 changed files with 188 additions and 229 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue