feat: add hl_group for file icons (#1131)

This commit is contained in:
Matthew Steedman
2022-04-04 03:33:11 -04:00
committed by GitHub
parent 6368880968
commit 924aa29092
2 changed files with 8 additions and 2 deletions

View File

@@ -83,8 +83,13 @@ if icon_state.show_file_icon then
end
end
else
get_file_icon = function()
return #icon_state.icons.default > 0 and icon_state.icons.default .. icon_padding or ""
get_file_icon = function(_, _, line, depth)
local hl_group = "NvimTreeFileIcon"
local icon = icon_state.icons.default
if #icon > 0 then
table.insert(hl, { hl_group, line, depth, depth + #icon + 1 })
end
return #icon > 0 and icon .. icon_padding or ""
end
end
end