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,3 @@
local Util = require("lazyvim.util")
---@class lazyvim.util.lualine
local M = {}
@ -25,9 +23,9 @@ function M.cmp_source(name, icon)
end
local colors = {
ok = Util.ui.fg("Special"),
error = Util.ui.fg("DiagnosticError"),
pending = Util.ui.fg("DiagnosticWarn"),
ok = LazyVim.ui.fg("Special"),
error = LazyVim.ui.fg("DiagnosticError"),
pending = LazyVim.ui.fg("DiagnosticWarn"),
}
return {
@ -90,8 +88,8 @@ function M.pretty_path(opts)
return ""
end
local root = Util.root.get({ normalize = true })
local cwd = Util.root.cwd()
local root = LazyVim.root.get({ normalize = true })
local cwd = LazyVim.root.cwd()
if opts.relative == "cwd" and path:find(cwd, 1, true) == 1 then
path = path:sub(#cwd + 2)
@ -130,12 +128,12 @@ function M.root_dir(opts)
parent = true,
other = true,
icon = "󱉭 ",
color = Util.ui.fg("Special"),
color = LazyVim.ui.fg("Special"),
}, opts or {})
local function get()
local cwd = Util.root.cwd()
local root = Util.root.get({ normalize = true })
local cwd = LazyVim.root.cwd()
local root = LazyVim.root.get({ normalize = true })
local name = vim.fs.basename(root)
if root == cwd then