CustomFoldRegion () { checkEnd(); int foldIndex = myLocation.foldRegion; if (foldIndex < myFoldRegions.length) { FoldRegion foldRegion = myFoldRegions[foldIndex]; if (foldRegion instanceof CustomFoldRegion && foldRegion.getStartOffset() == myLocation.offset) { return (CustomFoldRegion)foldRegion; } } return null; }