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

@@ -801,6 +801,7 @@ NvimTreeSymlink
NvimTreeFolderName NvimTreeFolderName
NvimTreeRootFolder NvimTreeRootFolder
NvimTreeFolderIcon NvimTreeFolderIcon
NvimTreeFileIcon
NvimTreeEmptyFolderName NvimTreeEmptyFolderName
NvimTreeOpenedFolderName NvimTreeOpenedFolderName
NvimTreeExecFile NvimTreeExecFile

View File

@@ -83,8 +83,13 @@ if icon_state.show_file_icon then
end end
end end
else else
get_file_icon = function() get_file_icon = function(_, _, line, depth)
return #icon_state.icons.default > 0 and icon_state.icons.default .. icon_padding or "" 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 end
end end