void (@NotNull Editor editor) { FoldingModel foldingModel = editor.getFoldingModel(); foldingModel.runBatchFoldingOperation(() -> { for (FoldRegion region : foldingModel.getAllFoldRegions()) { if (region instanceof CustomFoldRegion) { foldingModel.removeFoldRegion(region); } } }); }