ranges[i].start += adjustment;
}
}
else if (viewer instanceof ITextViewerExtension5) {
// use ITextViewerExtension5
ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
// convert document regions back to widget regions
for (int i = 0; i < ranges.length; i++) {
// get document range, taking into account folding
// regions in viewer
IRegion region = extension.modelRange2WidgetRange(new Region(ranges[i].start, ranges[i].length));
if (region != null) {
ranges[i].start = region.getOffset();
ranges[i].length = region.getLength();
} // else what happens if region is not found?!
}