* @param line the line after which the range has to occur
* @param size the minimal size of the range
* @return the first range found, or the last range in the differ if none can be found
*/
private RangeDifference findConsistentRangeAfterRight(int line, int size) {
RangeDifference found= null;
int unchanged= -1; // the number of unchanged lines after line
for (ListIterator it= fDifferences.listIterator(fDifferences.size()); it.hasPrevious();) {
RangeDifference difference= (RangeDifference) it.previous();
if (found == null)
found= difference;
else if (difference.kind() == RangeDifference.NOCHANGE) {
unchanged= difference.rightEnd() - Math.max(line + 1, difference.rightStart()); // + 1 to step over the changed line
if (unchanged >= size)
found= difference;
}
if (difference.rightStart() <= line)
break;
}
return found;
}