void (final boolean expanded) { if (myDuringSynchronize) return; myDuringSynchronize = true; try { for (int i = 0; i < myCount; i++) { final int index = i; final FoldingModelEx model = myEditors[index].getFoldingModel(); model.runBatchFoldingOperation(() -> { for (FoldedBlock folding : getFoldedBlocks()) { FoldRegion region = folding.getRegion(index); if (region != null) region.setExpanded(expanded); } }); } } finally { myDuringSynchronize = false; } }