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.json
local M = {}
@ -14,7 +13,7 @@ local function encode(value, indent)
elseif t == "number" or t == "boolean" then
return tostring(value)
elseif t == "table" then
local is_list = Util.is_list(value)
local is_list = LazyVim.is_list(value)
local parts = {}
local next_indent = indent .. " "
@ -51,13 +50,13 @@ function M.save()
local path = vim.fn.stdpath("config") .. "/lazyvim.json"
local f = io.open(path, "w")
if f then
f:write(Util.json.encode(Config.json.data))
f:write(LazyVim.json.encode(Config.json.data))
f:close()
end
end
function M.migrate()
Util.info("Migrating `lazyvim.json` to version `" .. Config.json.version .. "`")
LazyVim.info("Migrating `lazyvim.json` to version `" .. Config.json.version .. "`")
local json = Config.json
-- v0