Skip to content

Commit d3fa463

Browse files
committed
docs(filters): add clarifying comments to bookmark filter logic
1 parent 8d49e68 commit d3fa463

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lua/nvim-tree/explorer/filters.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function Filters:bookmark(path, path_type, bookmarks)
127127
if not self.state.no_bookmark then
128128
return false
129129
end
130-
130+
-- if bookmark is empty, we should see a empty filetree
131131
if next(bookmarks) == nil then
132132
return true
133133
end
@@ -141,6 +141,7 @@ function Filters:bookmark(path, path_type, bookmarks)
141141
end
142142

143143
if path_type == "directory" then
144+
-- check if path is mark's parent
144145
if vim.fn.stridx(bookmark_path, mark_parent) == 0 then
145146
return false
146147
end
@@ -149,6 +150,7 @@ function Filters:bookmark(path, path_type, bookmarks)
149150
---@type DirectoryNode?
150151
local dir = bookmark_entry:as(DirectoryNode)
151152
if dir then
153+
-- check if mark is path's parent
152154
local path_parent = utils.path_add_trailing(bookmark_path)
153155
if vim.fn.stridx(path, path_parent) == 0 then
154156
return false

0 commit comments

Comments
 (0)