private void foldPartitions(HashMap markerMap, String partitionType, boolean autoCollapse, int minLines) {
// This will hold the regions that should have folding markers.
ArrayList regions = new ArrayList();
IDocumentPartitioner partitioner = doc.getDocumentPartitioner();
ITypedRegion[] regionArray = partitioner.computePartitioning(0, doc.getLength());
for (int i = 0; i < regionArray.length; i++) {
ITypedRegion region = regionArray[i];
if (region.getType() == partitionType) {
// Position position= new Position(region.getOffset(),