Feat/icon highlighting for opened files and directories (#258)
This commit is contained in:
@@ -261,6 +261,7 @@ local function update_draw_data(tree, depth, markers)
|
||||
next = next.group_next
|
||||
end
|
||||
if not has_children then folder_hl = "NvimTreeEmptyFolderName" end
|
||||
if node.open then folder_hl = "NvimTreeOpenedFolderName" end
|
||||
set_folder_hl(index, offset, #icon, #name+#git_icon, folder_hl)
|
||||
if git_hl then
|
||||
set_folder_hl(index, offset, #icon, #name+#git_icon, git_hl)
|
||||
@@ -298,6 +299,12 @@ local function update_draw_data(tree, depth, markers)
|
||||
table.insert(hl, {'NvimTreeImageFile', index, offset+#icon+#git_icons, -1 })
|
||||
end
|
||||
|
||||
if vim.g.nvim_tree_highlight_opened_files then
|
||||
if vim.fn.bufloaded(node.absolute_path) > 0 then
|
||||
table.insert(hl, {'NvimTreeOpenedFile', index, offset, offset+#icon })
|
||||
end
|
||||
end
|
||||
|
||||
if git_hl then
|
||||
table.insert(hl, {git_hl, index, offset+#icon+#git_icons, -1 })
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user