// preRegion= new Region(offset + prefixEnd, contentStart -
// prefixEnd);
final int preOffset = document.getLineOffset(firstLine);
final IRegion preEndLineInfo = document.getLineInformation(captionLine);
final int preEnd = preEndLineInfo.getOffset();
preRegion = new Region(preOffset, preEnd - preOffset);
} else {
preRegion = null;
}
if (captionLine < lastLine) {
final int postOffset = document.getLineOffset(captionLine + 1);
final IRegion postRegion = new Region(postOffset, offset + length
- postOffset);
if (preRegion == null) {
return new IRegion[] { postRegion };
}