In merge view, when inserting a line widget on one side, how to insert a merge spacer on the other side to ensure that the code on both sides is aligned?
The number of lines and content in the red box as shown in the figure are not aligned.
In merge view, when inserting a line widget on one side, how to insert a merge spacer on the other side to ensure that the code on both sides is aligned?
I see the code of merge plugin, when to insert a linewidget, it calls this method
cm.on("lineWidgetAdded", function(_, widget, lineNo) {
if (widget.mergeSpacer) return
if (widget.above) self.set(lineNo - 1, F_WIDGET_BELOW)
else self.set(lineNo, F_WIDGET)
})
and then trigger the realign event, finally call the alignChunks method in update funcition, but the edit seems not redraw.
function update(mode) {
updating = true;
updatingFast = false;
if (mode == "full") {
if (dv.svg) clear(dv.svg);
if (dv.copyButtons) clear(dv.copyButtons);
clearMarks(dv.edit, edit.marked, dv.classes);
clearMarks(dv.orig, orig.marked, dv.classes);
edit.from = edit.to = orig.from = orig.to = 0;
} else if (mode === 'menual') {
updating = false;
setDealign(false, true);
}
ensureDiff(dv);
if (dv.showDifferences) {
updateMarks(dv.edit, dv.diff, edit, DIFF_INSERT, dv.classes);
updateMarks(dv.orig, dv.diff, orig, DIFF_DELETE, dv.classes);
}
if (dv.mv.options.connect == "align")
alignChunks(dv);
makeConnections(dv);
if (dv.needsScrollSync != null) syncScroll(dv, dv.needsScrollSync)
updating = false;
}
Hi, marijin, did you encount this problem? @marijn