|
345 | 345 | var ch = dv.chunks[i]; |
346 | 346 | if (ch.editFrom <= vpEdit.to && ch.editTo >= vpEdit.from && |
347 | 347 | ch.origFrom <= vpOrig.to && ch.origTo >= vpOrig.from) |
348 | | - drawConnectorsForChunk(dv, ch, sTopOrig, sTopEdit, w); |
| 348 | + drawConnectorsForChunk(dv, ch, sTopOrig, sTopEdit, w, i); |
349 | 349 | } |
350 | 350 | } |
351 | 351 |
|
|
524 | 524 | return cm.addLineWidget(line, elt, {height: size, above: false, mergeSpacer: true, handleMouseEvents: true}); |
525 | 525 | } |
526 | 526 |
|
527 | | - function drawConnectorsForChunk(dv, chunk, sTopOrig, sTopEdit, w) { |
| 527 | + function drawConnectorsForChunk(dv, chunk, sTopOrig, sTopEdit, w, index) { |
528 | 528 | var flip = dv.type == "left"; |
529 | 529 | var top = dv.orig.heightAtLine(chunk.origFrom, "local", true) - sTopOrig; |
530 | 530 | if (dv.svg) { |
|
552 | 552 | copy.chunk = chunk; |
553 | 553 | copy.style.top = (chunk.origTo > chunk.origFrom ? top : dv.edit.heightAtLine(chunk.editFrom, "local") - sTopEdit) + "px"; |
554 | 554 | copy.setAttribute("role", "button"); |
| 555 | + copy.setAttribute("data-chunk-index", index); |
555 | 556 |
|
556 | 557 | if (editOriginals) { |
557 | 558 | var leftButton = typeof dv.getLeftRevertButton === 'function' && dv.getLeftRevertButton("CodeMirror-merge-copy-reverse"); |
|
565 | 566 | copyReverse.style.top = topReverse + "px"; |
566 | 567 | dv.type == "right" ? copyReverse.style.left = "2px" : copyReverse.style.right = "2px"; |
567 | 568 | copyReverse.setAttribute("role", "button"); |
| 569 | + copyReverse.setAttribute("data-chunk-index", index); |
568 | 570 | } |
569 | 571 | } |
570 | 572 | } |
|
0 commit comments