Skip to content

Commit a981ef2

Browse files
authored
fix(ui): resolve linked highlight groups (#1929)
1 parent 0bf326c commit a981ef2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/neo-tree/ui/highlights.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ end
6969
---@param name string
7070
local get_hl_by_name = function(name)
7171
if vim.api.nvim_get_hl then
72-
local hl = vim.api.nvim_get_hl(0, { name = name })
72+
local hl = vim.api.nvim_get_hl(0, { name = name, link = false })
7373
---@diagnostic disable-next-line: inject-field
7474
hl.foreground = hl.fg
7575
---@diagnostic disable-next-line: inject-field
@@ -88,10 +88,10 @@ end
8888
---@param gui string? The gui to use, if the highlight group is not defined and it is not linked to another group.
8989
---@return table hlgroups The highlight group values.
9090
M.create_highlight_group = function(hl_group_name, link_to_if_exists, background, foreground, gui)
91-
local success, hl_group = pcall(get_hl_by_name, hl_group_name, true)
91+
local success, hl_group = pcall(get_hl_by_name, hl_group_name)
9292
if not success or not hl_group.foreground or not hl_group.background then
9393
for _, link_to in ipairs(link_to_if_exists) do
94-
success, hl_group = pcall(get_hl_by_name, link_to, true)
94+
success, hl_group = pcall(get_hl_by_name, link_to)
9595
if success then
9696
local new_group_has_settings = background or foreground or gui
9797
local link_to_has_settings = hl_group.foreground or hl_group.background

0 commit comments

Comments
 (0)