remove unused diff match path

This commit is contained in:
Val Erastov (xibyte) 2020-05-05 21:54:56 -07:00
parent 74fc6e3c87
commit 5a56478aec
2 changed files with 15 additions and 17 deletions

View file

@ -63,7 +63,6 @@
"dependencies": {
"classnames": "2.2.5",
"clipper-lib": "6.2.1",
"diff-match-patch": "1.0.0",
"earcut": "2.1.1",
"less": "^3.11.1",
"libtess": "1.2.2",

View file

@ -1,9 +1,8 @@
import diff_match_patch from 'diff-match-patch';
/** @constructor */
function HistoryManager(viewer) {
this.viewer = viewer;
this.dmp = new diff_match_patch();
// this.dmp = new diff_match_patch();
this.init({});
// this.init(this.viewer.io.serializeSketch());
}
@ -80,9 +79,9 @@ HistoryManager.prototype.redo = function () {
};
HistoryManager.prototype.applyDiff = function (text1, diff) {
var dmp = this.dmp;
var results = dmp.patch_apply(diff, text1);
return results[0];
// var dmp = this.dmp;
// var results = dmp.patch_apply(diff, text1);
// return results[0];
};
HistoryManager.prototype.applyDiffInv = function (text1, diff) {
@ -103,17 +102,17 @@ HistoryManager.prototype.reversePatch = function (plist) {
};
HistoryManager.prototype.getDiff = function (text1, text2) {
var dmp = this.dmp;
var diff = dmp.diff_main(text1, text2, true);
if (diff.length > 2) {
dmp.diff_cleanupSemantic(diff);
}
var patch_list = dmp.patch_make(text1, text2, diff);
//var patch_text = dmp.patch_toText(patch_list);
//console.log(patch_list);
return patch_list;
// var dmp = this.dmp;
// var diff = dmp.diff_main(text1, text2, true);
//
// if (diff.length > 2) {
// dmp.diff_cleanupSemantic(diff);
// }
//
// var patch_list = dmp.patch_make(text1, text2, diff);
// //var patch_text = dmp.patch_toText(patch_list);
// //console.log(patch_list);
// return patch_list;
};
export {HistoryManager}