mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-05 03:08:13 +00:00
fix(explorer): last status for indent guides taking hidden / ignored files into account
This commit is contained in:
parent
1b068a81cf
commit
94bd2eff74
1 changed files with 7 additions and 1 deletions
|
@ -223,6 +223,7 @@ function M.explorer(opts, ctx)
|
||||||
end
|
end
|
||||||
local items = {} ---@type table<string, snacks.picker.explorer.Item>
|
local items = {} ---@type table<string, snacks.picker.explorer.Item>
|
||||||
local top = Tree:find(ctx.filter.cwd)
|
local top = Tree:find(ctx.filter.cwd)
|
||||||
|
local last = {} ---@type table<snacks.picker.explorer.Node, snacks.picker.explorer.Item>
|
||||||
Tree:get(ctx.filter.cwd, function(node)
|
Tree:get(ctx.filter.cwd, function(node)
|
||||||
local item = {
|
local item = {
|
||||||
file = node.path,
|
file = node.path,
|
||||||
|
@ -233,11 +234,16 @@ function M.explorer(opts, ctx)
|
||||||
hidden = node.hidden,
|
hidden = node.hidden,
|
||||||
ignored = node.ignored,
|
ignored = node.ignored,
|
||||||
status = (not node.dir or not node.open or opts.git_status_open) and node.status or nil,
|
status = (not node.dir or not node.open or opts.git_status_open) and node.status or nil,
|
||||||
last = node.last,
|
last = true,
|
||||||
type = node.type,
|
type = node.type,
|
||||||
}
|
}
|
||||||
|
if last[node.parent] then
|
||||||
|
last[node.parent].last = false
|
||||||
|
end
|
||||||
|
last[node.parent] = item
|
||||||
if top == node then
|
if top == node then
|
||||||
item.hidden = false
|
item.hidden = false
|
||||||
|
item.ignored = false
|
||||||
end
|
end
|
||||||
items[node.path] = item
|
items[node.path] = item
|
||||||
cb(item)
|
cb(item)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue