Skip to content

Commit b5f9810

Browse files
committed
[merge addon] Fix bug when merging a deletion at the bottom of the document
Closes codemirror#3802
1 parent 63f762b commit b5f9810

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

addon/merge/merge.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
position: absolute;
6161
cursor: pointer;
6262
color: #44c;
63+
z-index: 3;
6364
}
6465

6566
.CodeMirror-merge-copy-reverse {

addon/merge/merge.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,9 @@
427427

428428
function copyChunk(dv, to, from, chunk) {
429429
if (dv.diffOutOfDate) return;
430+
var start = chunk.editTo > to.lastLine() ? Pos(chunk.editFrom - 1) : Pos(chunk.editFrom, 0)
430431
to.replaceRange(from.getRange(Pos(chunk.origFrom, 0), Pos(chunk.origTo, 0)),
431-
Pos(chunk.editFrom, 0), Pos(chunk.editTo, 0));
432+
start, Pos(chunk.editTo, 0));
432433
}
433434

434435
// Merge view, containing 0, 1, or 2 diff views.

0 commit comments

Comments
 (0)