-
Notifications
You must be signed in to change notification settings - Fork 356
Open
Description
In NSOutlineView+Changeset.swift:
@objc(outlineView:isItemExpandable:)
open func outlineView(_ outlineView: NSOutlineView, isItemExpandable item: Any) -> Bool {
guard let item = item as? ObjectTreeNode<Changeset.Collection.Children.Element> else { return false }
return isItemExpandable?(item.value, outlineView) ?? item.children.isEmpty == false
}It look like the intent of the last line is:
return isItemExpandable?(item.value, outlineView) ?? (item.children.isEmpty == false)
However, ?? binds tighter than ==, so this line is actually:
return (isItemExpandable?(item.value, outlineView) ?? item.children.isEmpty) == false
which inverts the sense of isItemExpandable. Proposed fix:
return isItemExpandable?(item.value, outlineView) ?? !item.children.isEmpty
or altnernatively:
return isItemExpandable?(item.value, outlineView) ?? (item.children.isEmpty == false)
Workaround: user-supplied isItemExpandable must return false to make item expandable.
I can supply a PR if needed, but this is an easy fix.
Metadata
Metadata
Assignees
Labels
No labels