diff --git a/src/utils/VisibleNodesGenerator.ts b/src/utils/VisibleNodesGenerator.ts index c869319..52f8015 100644 --- a/src/utils/VisibleNodesGenerator.ts +++ b/src/utils/VisibleNodesGenerator.ts @@ -287,18 +287,15 @@ class FlattenLayer extends CompressLayer { const rootNode = this.compressedRoot if (rootNode) { await traverse( - [rootNode], + rootNode.contents, async node => { - const overflowChar = node.path[path.length + 1] + const overflowChar = path[node.path.length] const match = path.startsWith(node.path) && (overflowChar === '/' || !overflowChar) - if (node.path) { - // rootNode.path === '' - if (match) { - if (node.path === path) { - // do not wait for expansion for the exact node as that will block "jumping from search" - this.$setExpand(node, true) - } else await this.$setExpand(node, true) - } + if (match) { + if (node.path === path) { + // do not wait for expansion for the exact node as that will block "jumping from search" + this.$setExpand(node, true) + } else await this.$setExpand(node, true) } return match },