mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-09 00:44:40 +02:00
fix(util.ui.fg): Add link=false
to show effective definition (#2542)
Fixes #2540 by showing the effective definition instead of the linked group name.
This commit is contained in:
parent
f23d3cee42
commit
5012d7d839
1 changed files with 2 additions and 1 deletions
|
@ -142,7 +142,8 @@ 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)
|
||||
local hl = vim.api.nvim_get_hl and vim.api.nvim_get_hl(0, { name = name, link = false })
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue