Skip to content

Commit

Permalink
Merge pull request #151 from kishikawakatsumi/fix
Browse files Browse the repository at this point in the history
Fix expanding directory
  • Loading branch information
kishikawakatsumi authored Sep 23, 2024
2 parents 549a2a3 + d431fdd commit aa9491e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ class DirectoryStructure {
let children = children(of: fileNode)

let (deleted, inserted) = nodeDelta(oldNodes: children, newNodes: nodes)

tree.nodes = Array(
Set(nodes)
.union(
Set(tree.nodes).subtracting(tree.rootNodes())
Set(tree.nodes).subtracting(children)
)
)

viewTree = viewTree(tree)

outlineView.beginUpdates()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class FilesViewController: NSViewController {
tabGroupObserving = tabGroup.observe(\.selectedWindow) { [weak self] (tabGroup, change) in
guard let self = self else { return }
if window == tabGroup.selectedWindow {
guard self == navigationController()?.topViewController else {
return
}
dirTree.update(outlineView)
self.updateItemCount()
}
Expand Down

0 comments on commit aa9491e

Please sign in to comment.