vendor/assets/javascripts/codemirror/addons/merge/merge.js in codemirror-rails-5.11.1 vs vendor/assets/javascripts/codemirror/addons/merge/merge.js in codemirror-rails-5.12
- old
+ new
@@ -425,11 +425,12 @@
}
}
function copyChunk(dv, to, from, chunk) {
if (dv.diffOutOfDate) return;
+ var start = chunk.editTo > to.lastLine() ? Pos(chunk.editFrom - 1) : Pos(chunk.editFrom, 0)
to.replaceRange(from.getRange(Pos(chunk.origFrom, 0), Pos(chunk.origTo, 0)),
- Pos(chunk.editFrom, 0), Pos(chunk.editTo, 0));
+ start, Pos(chunk.editTo, 0));
}
// Merge view, containing 0, 1, or 2 diff views.
var MergeView = CodeMirror.MergeView = function(node, options) {