void (int startLine, int endLine) { FoldingModel foldingModel = getEditor().getFoldingModel(); foldingModel.runBatchFoldingOperation(() -> foldingModel.addCustomLinesFolding(startLine, endLine, new OurCustomFoldRegionRenderer())); }