feat(nvim-tree): aggregate child git status onto directory nodes
This commit is contained in:
+13
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user