Skip to content

Commit 5e9a08b

Browse files
committed
fix: change hide_root_node method, fixes #410
1 parent aab34f7 commit 5e9a08b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lua/neo-tree/ui/renderer.lua

+3-5
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ M.render_component = function(component, item, state, remaining_width)
278278
end
279279

280280
local prepare_node = function(item, state)
281+
if item.level == 0 and require("neo-tree").config.hide_root_node then
282+
return nil
283+
end
281284
local line = NuiLine()
282285

283286
local renderer = state.renderers[item.type]
@@ -987,11 +990,6 @@ M.show_nodes = function(sourceItems, state, parentId, callback)
987990

988991
if sourceItems then
989992
-- normal path
990-
if parentId == nil and require("neo-tree").config.hide_root_node then
991-
-- if we are not showing the root node, then we need to remove it from the list
992-
-- of items to display.
993-
sourceItems = sourceItems[1].children
994-
end
995993
local nodes = create_nodes(sourceItems, state, level)
996994
draw(nodes, state, parentId)
997995
else

0 commit comments

Comments
 (0)