Skip to content

Commit e6ec325

Browse files
committed
Make sure initial connectors are drawn after aligning/collapsing
So that their vertical offsets actually match the position of the corresponding lines. Issue codemirror#4364
1 parent f5e211f commit e6ec325

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

addon/merge/merge.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
this.diffOutOfDate = this.dealigned = false;
5050

5151
this.showDifferences = options.showDifferences !== false;
52+
},
53+
registerEvents: function() {
5254
this.forceUpdate = registerUpdate(this);
5355
setScrollLock(this, true, false);
5456
registerScroll(this);
@@ -91,10 +93,11 @@
9193
updateMarks(dv.edit, dv.diff, edit, DIFF_INSERT, dv.classes);
9294
updateMarks(dv.orig, dv.diff, orig, DIFF_DELETE, dv.classes);
9395
}
94-
makeConnections(dv);
9596

9697
if (dv.mv.options.connect == "align")
9798
alignChunks(dv);
99+
makeConnections(dv);
100+
98101
updating = false;
99102
}
100103
function setDealign(fast) {
@@ -489,7 +492,6 @@
489492

490493
if (left) left.init(leftPane, origLeft, options);
491494
if (right) right.init(rightPane, origRight, options);
492-
493495
if (options.collapseIdentical)
494496
this.editor().operation(function() {
495497
collapseIdenticalStretches(self, options.collapseIdentical);
@@ -498,6 +500,9 @@
498500
this.aligners = [];
499501
alignChunks(this.left || this.right, true);
500502
}
503+
if (left) left.registerEvents()
504+
if (right) right.registerEvents()
505+
501506

502507
var onResize = function() {
503508
if (left) makeConnections(left);

0 commit comments

Comments
 (0)