Skip to content

Commit

Permalink
make things actually work
Browse files Browse the repository at this point in the history
  • Loading branch information
ansuz committed Feb 1, 2018
1 parent 0672c2f commit a281869
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions customize.dist/delta-words.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ define([
return offset;
};

var opsToWords = function (last, current) {
var opsToWords = function (previous, current) {
var output = [];
Diff.diff(A, B).forEach(function (op) {
Diff.diff(previous, current).forEach(function (op) {
// ignore deleted sections...
var offset = op.offset;
var toInsert = op.toInsert;

// given an operation, check whether it is a word fragment,
// if it is, expand it to its word boundaries
var first = B.slice(leadingBoundary(B, offset), offset);
var last = B.slice(offset + toInsert.length, trailingBoundary(B, offset + toInsert.length));
var first = current.slice(leadingBoundary(current, offset), offset);
var last = current.slice(offset + toInsert.length, trailingBoundary(current, offset + toInsert.length));

var result = first + toInsert + last;
// concat-in-place
Array.prototype.push.apply(output, result.split(/\s+/));
});
return output;
return output.filter(Boolean);
};

var runningDiff = function (getter, f, time) {
Expand Down

0 comments on commit a281869

Please sign in to comment.