|
|
@ -3,6 +3,7 @@ define([
|
|
|
|
var module = { exports: {} };
|
|
|
|
var module = { exports: {} };
|
|
|
|
var transformCursor = function (cursor, op) {
|
|
|
|
var transformCursor = function (cursor, op) {
|
|
|
|
if (!op) { return cursor; }
|
|
|
|
if (!op) { return cursor; }
|
|
|
|
|
|
|
|
|
|
|
|
var pos = op.offset;
|
|
|
|
var pos = op.offset;
|
|
|
|
var remove = op.toRemove;
|
|
|
|
var remove = op.toRemove;
|
|
|
|
var insert = op.toInsert.length;
|
|
|
|
var insert = op.toInsert.length;
|
|
|
@ -17,10 +18,12 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
module.exports.transformCursor = function (cursor, ops) {
|
|
|
|
module.exports.transformCursor = function (cursor, ops) {
|
|
|
|
if (Array.isArray(ops)) {
|
|
|
|
if (Array.isArray(ops)) {
|
|
|
|
for (var i = ops.length - 1; i >= 0; i--) { transformCursor(cursor, ops[i]); }
|
|
|
|
for (var i = ops.length - 1; i >= 0; i--) {
|
|
|
|
return;
|
|
|
|
cursor = transformCursor(cursor, ops[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
transformCursor(ops);
|
|
|
|
return cursor;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return transformCursor(ops);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
return module.exports;
|
|
|
|
return module.exports;
|
|
|
|
});
|
|
|
|
});
|