Skip to content

Commit 22e2bb3

Browse files
committed
fix: nevr hide root folder, fixes #184
1 parent e72bf2b commit 22e2bb3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lua/neo-tree/command/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ M.execute = function(args)
112112

113113
-- All set, now show or focus the window
114114
local force_navigate = path_changed or do_reveal or state.dirty
115-
if position_changed then
115+
if position_changed and args.position ~= "current" and current_position ~= "current" then
116116
manager.close(args.source)
117117
end
118118
if do_reveal then

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function create_item(context, path, _type)
5656

5757
local state = context.state
5858
local f = state.filtered_items
59-
local is_not_root = context.state.path ~= path
59+
local is_not_root = not utils.is_subpath(path, context.state.path)
6060
if f and is_not_root then
6161
if f.hide_by_name[name] then
6262
item.filtered_by = item.filtered_by or {}

0 commit comments

Comments
 (0)