fix: colors setup highlight and folder highlight range fix (#788)
This commit is contained in:
@@ -7,7 +7,7 @@ local function get_color_from_hl(hl_name, fallback)
|
|||||||
local id = vim.api.nvim_get_hl_id_by_name(hl_name)
|
local id = vim.api.nvim_get_hl_id_by_name(hl_name)
|
||||||
if not id then return fallback end
|
if not id then return fallback end
|
||||||
|
|
||||||
local foreground = vim.fn.synIDattr(id, "fg")
|
local foreground = vim.fn.synIDattr(vim.fn.synIDtrans(id), "fg")
|
||||||
if not foreground or foreground == "" then return fallback end
|
if not foreground or foreground == "" then return fallback end
|
||||||
|
|
||||||
return foreground
|
return foreground
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ local function update_draw_data(tree, depth, markers)
|
|||||||
if node.entries then
|
if node.entries then
|
||||||
local has_children = #node.entries ~= 0 or node.has_children
|
local has_children = #node.entries ~= 0 or node.has_children
|
||||||
local icon = get_folder_icon(node.open, node.link_to ~= nil, has_children)
|
local icon = get_folder_icon(node.open, node.link_to ~= nil, has_children)
|
||||||
local git_icon = get_git_icons(node, index, offset, #icon+1) or ""
|
local git_icon = get_git_icons(node, index, offset, #icon) or ""
|
||||||
-- INFO: this is mandatory in order to keep gui attributes (bold/italics)
|
-- INFO: this is mandatory in order to keep gui attributes (bold/italics)
|
||||||
local folder_hl = "NvimTreeFolderName"
|
local folder_hl = "NvimTreeFolderName"
|
||||||
local name = node.name
|
local name = node.name
|
||||||
@@ -310,9 +310,9 @@ local function update_draw_data(tree, depth, markers)
|
|||||||
if special[node.absolute_path] then
|
if special[node.absolute_path] then
|
||||||
folder_hl = "NvimTreeSpecialFolderName"
|
folder_hl = "NvimTreeSpecialFolderName"
|
||||||
end
|
end
|
||||||
set_folder_hl(index, offset, #icon, #name+#git_icon, folder_hl)
|
set_folder_hl(index, offset, #icon+#git_icon, #name, folder_hl)
|
||||||
if git_hl then
|
if git_hl then
|
||||||
set_folder_hl(index, offset, #icon, #name+#git_icon, git_hl)
|
set_folder_hl(index, offset, #icon+#git_icon, #name, git_hl)
|
||||||
end
|
end
|
||||||
index = index + 1
|
index = index + 1
|
||||||
if node.open then
|
if node.open then
|
||||||
|
|||||||
Reference in New Issue
Block a user