summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/addon/merge
diff options
context:
space:
mode:
authorCheng-Han, Wu2016-04-20 18:11:40 +0800
committerCheng-Han, Wu2016-04-20 18:11:40 +0800
commit8bf516263c6582771e7576e8484ca8cfaa8cb9cb (patch)
treeaba81172f554a50466a762db99f25e3650d7ff45 /public/vendor/codemirror/addon/merge
parentedc3a31dfdb03e910d7355144280e281eeb582d5 (diff)
Update CodeMirror to 5.13.5
Diffstat (limited to 'public/vendor/codemirror/addon/merge')
-rw-r--r--public/vendor/codemirror/addon/merge/merge.css1
-rw-r--r--public/vendor/codemirror/addon/merge/merge.js5
2 files changed, 4 insertions, 2 deletions
diff --git a/public/vendor/codemirror/addon/merge/merge.css b/public/vendor/codemirror/addon/merge/merge.css
index a6a80e43..bda3d9f8 100644
--- a/public/vendor/codemirror/addon/merge/merge.css
+++ b/public/vendor/codemirror/addon/merge/merge.css
@@ -60,6 +60,7 @@
position: absolute;
cursor: pointer;
color: #44c;
+ z-index: 3;
}
.CodeMirror-merge-copy-reverse {
diff --git a/public/vendor/codemirror/addon/merge/merge.js b/public/vendor/codemirror/addon/merge/merge.js
index 830a5f02..d67b760c 100644
--- a/public/vendor/codemirror/addon/merge/merge.js
+++ b/public/vendor/codemirror/addon/merge/merge.js
@@ -427,8 +427,9 @@
function copyChunk(dv, to, from, chunk) {
if (dv.diffOutOfDate) return;
- to.replaceRange(from.getRange(Pos(chunk.origFrom, 0), Pos(chunk.origTo, 0)),
- Pos(chunk.editFrom, 0), Pos(chunk.editTo, 0));
+ var editStart = chunk.editTo > to.lastLine() ? Pos(chunk.editFrom - 1) : Pos(chunk.editFrom, 0)
+ var origStart = chunk.origTo > from.lastLine() ? Pos(chunk.origFrom - 1) : Pos(chunk.origFrom, 0)
+ to.replaceRange(from.getRange(origStart, Pos(chunk.origTo, 0)), editStart, Pos(chunk.editTo, 0))
}
// Merge view, containing 0, 1, or 2 diff views.