Skip to content

Commit 7611094

Browse files
committed
feat: never hide nested files, closes #199
1 parent 311fbd1 commit 7611094

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lua/neo-tree/sources/common/file-items.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ function set_parents(context, item)
131131
context.folders[parent.id] = parent
132132
set_parents(context, parent)
133133
end
134-
table.insert((nesting_parent and nesting_parent.children) or parent.children, item)
134+
if nesting_parent then
135+
table.insert(nesting_parent.children, item)
136+
item.is_nested = true
137+
else
138+
table.insert(parent.children, item)
139+
end
135140
context.existing_items[item.id] = true
136141

137142
if item.filtered_by == nil and type(parent.filtered_by) == "table" then

lua/neo-tree/ui/renderer.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ local remove_filtered = function(source_items, filtered_items)
8080
for _, child in ipairs(source_items) do
8181
local fby = child.filtered_by
8282
if type(fby) == "table" then
83-
if filtered_items.visible and not fby.never_show then
83+
if (filtered_items.visible or child.is_nested) and not fby.never_show then
8484
table.insert(filtered, child)
8585
end
8686
else
@@ -113,6 +113,7 @@ create_nodes = function(source_items, state, level)
113113
loaded = item.loaded,
114114
filtered_by = item.filtered_by,
115115
extra = item.extra,
116+
is_nested = item.is_nested,
116117
-- TODO: The below properties are not universal and should not be here.
117118
-- Maybe they should be moved to the "extra" field?
118119
is_link = item.is_link,

0 commit comments

Comments
 (0)