Skip to content

Commit 75b0fd0

Browse files
authored
Merge pull request #114 from wayjam/fix/expand-path
fix: invalid expand path
2 parents 80b241b + 1d73b52 commit 75b0fd0

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/utils/VisibleNodesGenerator.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -287,18 +287,15 @@ class FlattenLayer extends CompressLayer {
287287
const rootNode = this.compressedRoot
288288
if (rootNode) {
289289
await traverse(
290-
[rootNode],
290+
rootNode.contents,
291291
async node => {
292-
const overflowChar = node.path[path.length + 1]
292+
const overflowChar = path[node.path.length]
293293
const match = path.startsWith(node.path) && (overflowChar === '/' || !overflowChar)
294-
if (node.path) {
295-
// rootNode.path === ''
296-
if (match) {
297-
if (node.path === path) {
298-
// do not wait for expansion for the exact node as that will block "jumping from search"
299-
this.$setExpand(node, true)
300-
} else await this.$setExpand(node, true)
301-
}
294+
if (match) {
295+
if (node.path === path) {
296+
// do not wait for expansion for the exact node as that will block "jumping from search"
297+
this.$setExpand(node, true)
298+
} else await this.$setExpand(node, true)
302299
}
303300
return match
304301
},

0 commit comments

Comments
 (0)