void (@NotNull final Editor editor, @Nullable Caret caret, DataContext dataContext) { final List<FoldRegion> regions = getFoldRegionsForSelection(editor, caret); editor.getFoldingModel().runBatchFoldingOperation(() -> { for (FoldRegion region : regions) { region.setExpanded(false); } }); }