return combineAndMarkRangesWithSource(insPoint, insPoint, start, end, source1, source2);
}
public IntSliceSeq combineAndMarkRangesWithSource(int start1, int end1, int start2, int end2, int source1, int source2) {
mergeRanges.clear();
IntSliceSeq mergedLines = new IntSliceSeq(2, end2-start2, 0);
for (int i = start2; i < end2; i++) {
mergedLines.add(source1, 0);
}
// [s1Start..s1End) // range in p1 seen as changed in m
for (RangePair p1_b : p1ToBase.findInSource(start1, end1)) {
// there might be few ranges in (p1-base) that overlap with (p1-m) changes
for (RangePair b_p2 : baseToP2.findInSource(p1_b.start2(), p1_b.end2())) {
// regions in p2 that correspond to affected regions in base
for (int p2Line = b_p2.start2(); p2Line < b_p2.end2(); p2Line++) {
for (RangePairSeq eq : matches) {
if (eq.includesOriginLine(p2Line)) {
// this line in p2 is equal to some line in merge
int mergeLine = eq.mapLineIndex(p2Line);
if (mergeLine >= start2 && mergeLine < end2) {
mergedLines.set(mergeLine - start2, source2, p2Line);
}
}
}
}
}