feat(nvim-tree): aggregate child git status onto directory nodes

This commit is contained in:
2026-05-07 00:10:01 +02:00
parent 7083584628
commit 66ceb352aa
3 changed files with 37 additions and 3 deletions
+13 -3
View File
@@ -57,7 +57,14 @@ local function entries_for(node)
return
end
local rel = vim.fs.relpath(r.worktree, node.absolute_path)
return rel and r.status.entries[rel]
if not rel then
return
end
if node.type == "directory" then
local list = r.status:aggregate_at(rel)
return #list > 0 and list or nil
end
return r.status.entries[rel]
end
---@param node Node
@@ -83,11 +90,14 @@ function GitDecorator.highlight_group(_, node)
if not list then
return
end
local hl
for _, entry in ipairs(list) do
if entry.kind == "ignored" then
return entry.hl
if entry.kind ~= "ignored" then
return
end
hl = hl or entry.hl
end
return hl
end
local signs = require("lsp.diagnostic").signs