fix(#1740): Error while running :NvimTreeCollapseKeepBuffers (#1741)

This commit is contained in:
Maxim Sokolov 2022-11-12 20:52:44 -08:00 committed by GitHub
parent f1f89f2062
commit cf908370fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,9 @@ function M.fn(keep_buffers)
Iterator.builder(core.get_explorer().nodes)
:hidden()
:applier(function(node)
node.open = keep_buffers == true and matches(node.absolute_path)
if node.nodes ~= nil then
node.open = keep_buffers == true and matches(node.absolute_path)
end
end)
:recursor(function(n)
return n.nodes