diff --git a/lua/nvim-tree/explorer/filters.lua b/lua/nvim-tree/explorer/filters.lua index 395e3927b75..990453455b3 100644 --- a/lua/nvim-tree/explorer/filters.lua +++ b/lua/nvim-tree/explorer/filters.lua @@ -73,7 +73,20 @@ end ---@param path string ---@param bookmarks table absolute paths bookmarked local function bookmark(path, bookmarks) - return M.config.filter_no_bookmark and not bookmarks[path] + if not M.config.filter_no_bookmark then + return false + end + + -- add trailing slash to make it match only mark's parent directory + -- not it's siblings + local parent = utils.path_add_trailing(path) + for mark, _ in pairs(bookmarks) do + if path == mark or vim.fn.stridx(mark, parent) == 0 then + return false + end + end + + return true end ---@param path string