Compare commits

...

3 Commits

Author SHA1 Message Date
Jamie Peabody
fd09b9761d patch(#104): fixes rendering beyond change constraint 2020-06-14 20:32:06 +01:00
Jamie Peabody
b3f417e9af patch(#104): fixes rendering beyond change constraint 2020-06-14 20:31:08 +01:00
Jamie Peabody
827c9ed8ef removed unnecessary addon 2020-01-03 23:10:02 +00:00
4 changed files with 9 additions and 11 deletions

View File

@@ -1,5 +1,8 @@
# Changes
## 4.0.15
* patch: removed unnecessary addon mark-selected
## 4.0.14
* patch: fixes issue #104 where diff text conflicted with selected text

View File

@@ -1,3 +1,4 @@
require('codemirror/addon/selection/mark-selection.js');
require('codemirror/lib/codemirror.css');
require('../src/mergely.css');

View File

@@ -1,6 +1,6 @@
{
"name": "mergely",
"version": "4.0.14",
"version": "4.0.16",
"description": "A javascript UI for diff/merge",
"directories": {
"doc": "doc",

View File

@@ -1357,17 +1357,17 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
}
else if (change['op'] == 'c') {
// apply LCS changes to each line
for (j = llf, k = rlf, p = 0;
for (j = llf, k = rlf;
((j >= 0) && (j <= llt)) || ((k >= 0) && (k <= rlt));
++j, ++k) {
var lhs_line, rhs_line;
if (k + p > rlt && this._is_change_in_view('lhs', lhsvp, change)) {
if (k > rlt) {
// lhs continues past rhs, mark lhs as deleted
lhs_line = led.getLine( j );
marktext.push([led, {line:j, ch:0}, {line:j, ch:lhs_line.length}, {className: 'mergely ch d lhs'}]);
continue;
}
if (j + p > llt && this._is_change_in_view('rhs', rhsvp, change)) {
if (j > llt) {
// rhs continues past lhs, mark rhs as added
rhs_line = red.getLine( k );
marktext.push([red, {line:k, ch:0}, {line:k, ch:rhs_line.length}, {className: 'mergely ch a rhs'}]);
@@ -1766,10 +1766,4 @@ jQuery.pluginMaker = function(plugin) {
// make the mergely widget
jQuery.pluginMaker(Mgly.mergely);
})(
require('jquery'),
require('CodeMirror'),
{
markSelection: require('../node_modules/codemirror/addon/selection/mark-selection.js')
}
);
})(require('jquery'), require('CodeMirror'));