mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 00:49:03 +02:00
perf(util): split lazyvim.util in smaller separate modules
This commit is contained in:
parent
5f5acb5b88
commit
c8c929c9fd
20 changed files with 442 additions and 283 deletions
|
@ -1,3 +1,4 @@
|
|||
---@class lazyvim.util.ui
|
||||
local M = {}
|
||||
|
||||
---@alias Sign {name:string, text:string, texthl:string, priority:number}
|
||||
|
@ -119,4 +120,13 @@ function M.statuscolumn()
|
|||
}, "")
|
||||
end
|
||||
|
||||
function M.fg(name)
|
||||
---@type {foreground?:number}?
|
||||
---@diagnostic disable-next-line: deprecated
|
||||
local hl = vim.api.nvim_get_hl and vim.api.nvim_get_hl(0, { name = name }) or vim.api.nvim_get_hl_by_name(name, true)
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
local fg = hl and (hl.fg or hl.foreground)
|
||||
return fg and { fg = string.format("#%06x", fg) } or nil
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue