void (final EditorEx editor, Random random) { DocumentEx document = editor.getDocument(); if (document.isInBulkUpdate()) return; FoldingModelEx foldingModel = editor.getFoldingModel(); foldingModel.runBatchFoldingOperation(foldingModel::clearFoldRegions); }