int (int index) { FoldRegion region = myRegions[index]; if (region == null || !region.isValid()) { return -1; } else { return myEditors[index].getDocument().getLineNumber(region.getStartOffset()); } }