gap.setLength(temp);
if ((includeZeroLengthPartitions && overlapsOrTouches(gap, offset, length)) ||
(gap.getLength() > 0 && gap.overlapsWith(offset, length))) {
start= Math.max(offset, gapOffset);
end= Math.min(endOffset, gap.getOffset() + gap.getLength());
list.add(new TypedRegion(start, end - start, IDocument.DEFAULT_CONTENT_TYPE));
}
if (current.overlapsWith(offset, length)) {
start= Math.max(offset, current.getOffset());
end= Math.min(endOffset, current.getOffset() + current.getLength());
list.add(new TypedRegion(start, end - start, current.getType()));
}
}
// gap.setLength(current.getOffset() - gapOffset);
// if ((includeZeroLengthPartitions && overlapsOrTouches(gap, offset, length)) ||
// (gap.getLength() > 0 && gap.overlapsWith(offset, length))) {
// start= Math.max(offset, gapOffset);
// end= Math.min(endOffset, gap.getOffset() + gap.getLength());
// list.add(new TypedRegion(start, end - start, IDocument.DEFAULT_CONTENT_TYPE));
// }
//
// if (current.overlapsWith(offset, length)) {
// start= Math.max(offset, current.getOffset());
// end= Math.min(endOffset, current.getOffset() + current.getLength());
// list.add(new TypedRegion(start, end - start, current.getType()));
// }
previous= current;
}
if (previous != null) {
gapOffset= previous.getOffset() + previous.getLength();
gap.setOffset(gapOffset);
gap.setLength(fDocument.getLength() - gapOffset);
if ((includeZeroLengthPartitions && overlapsOrTouches(gap, offset, length)) ||
(gap.getLength() > 0 && gap.overlapsWith(offset, length))) {
start= Math.max(offset, gapOffset);
end= Math.min(endOffset, fDocument.getLength());
list.add(new TypedRegion(start, end - start, IDocument.DEFAULT_CONTENT_TYPE));
}
}
if (list.isEmpty())
list.add(new TypedRegion(offset, length, IDocument.DEFAULT_CONTENT_TYPE));
} catch (BadPositionCategoryException ex) {
// Make sure we clear the cache
clearPositionCache();
} catch (RuntimeException ex) {