IJPL-172840 Decrease the limit of announced expanded roots

(cherry picked from commit e9d87312c7b53be5081c0ea557f43f5912455919)

IJ-CR-151182

GitOrigin-RevId: eae1f5bb0161acf5cd4d9070421f53e4fceea6df
This commit is contained in:
Dmitry Drobotov
2024-12-23 10:50:30 +01:00
committed by intellij-monorepo-bot
parent eaf47ca357
commit 172f70cd40

View File

@@ -1506,8 +1506,8 @@ public class Tree extends JTree implements ComponentWithEmptyText, ComponentWith
markPathExpanded(path);
fireTreeExpanded(path);
var parent = path.getParentPath();
// Limit expanded roots to 10 to prevent too many announcements and performance issues caused by it.
if (expandRoots.size() <= 10 && (parent == null || !toExpand.contains(parent))) {
// Limit expanded roots to 5 to prevent too many announcements and performance issues caused by it.
if (expandRoots.size() < 5 && (parent == null || !toExpand.contains(parent))) {
expandRoots.add(path);
}
}