Skip to content

Commit 96bc982

Browse files
committed
feat: remove indent from root node if it is hidden, fixes #426
1 parent 15db180 commit 96bc982

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/neo-tree/ui/renderer.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ 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
281+
if item.level < 0 then
282282
return nil
283283
end
284284
local line = NuiLine()
@@ -948,6 +948,10 @@ M.show_nodes = function(sourceItems, state, parentId, callback)
948948
state.longest_node = 0
949949
end
950950

951+
if require("neo-tree").config.hide_root_node then
952+
level = level - 1
953+
end
954+
951955
if state.group_empty_dirs then
952956
if parent then
953957
-- this is a lazy load of a single sub folder

0 commit comments

Comments
 (0)