Skip to content

Commit 593a82e

Browse files
committed
Add fallback name sort to CompareByComponentType. Closes #4771
1 parent b08cfef commit 593a82e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerItemComparer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ public override int Compare(ICodeExplorerNode x, ICodeExplorerNode y)
192192
return 1;
193193
}
194194

195-
return SortOrder[first.Value].CompareTo(SortOrder[second.Value]);
195+
var component = SortOrder[first.Value].CompareTo(SortOrder[second.Value]);
196+
197+
return component == 0 ? CodeExplorerItemComparer.Name.Compare(x, y) : component;
196198
}
197199
}
198200

0 commit comments

Comments
 (0)