|
@@ -306,7 +306,6 @@ class RangesTracker {
|
|
|
const opLength = op.i.length
|
|
const opLength = op.i.length
|
|
|
const opEnd = op.p + opLength
|
|
const opEnd = op.p + opLength
|
|
|
const undoing = !!op.u
|
|
const undoing = !!op.u
|
|
|
- const fixedRemoveChange = op.fixedRemoveChange
|
|
|
|
|
|
|
|
|
|
let alreadyMerged = false
|
|
let alreadyMerged = false
|
|
|
let previousChange = null
|
|
let previousChange = null
|
|
@@ -472,11 +471,7 @@ class RangesTracker {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (change of removeChanges) {
|
|
for (change of removeChanges) {
|
|
|
- if (fixedRemoveChange) {
|
|
|
|
|
- this._removeChange(change)
|
|
|
|
|
- } else {
|
|
|
|
|
- this._brokenRemoveChange(change)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this._removeChange(change)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (change of movedChanges) {
|
|
for (change of movedChanges) {
|
|
@@ -489,7 +484,6 @@ class RangesTracker {
|
|
|
const opLength = op.d.length
|
|
const opLength = op.d.length
|
|
|
const opEnd = op.p + opLength
|
|
const opEnd = op.p + opLength
|
|
|
const removeChanges = []
|
|
const removeChanges = []
|
|
|
- const fixedRemoveChange = op.fixedRemoveChange
|
|
|
|
|
let movedChanges = []
|
|
let movedChanges = []
|
|
|
|
|
|
|
|
// We might end up modifying our delete op if it merges with existing deletes, or cancels out
|
|
// We might end up modifying our delete op if it merges with existing deletes, or cancels out
|
|
@@ -617,11 +611,7 @@ class RangesTracker {
|
|
|
movedChanges.push(change)
|
|
movedChanges.push(change)
|
|
|
op.d = '' // stop it being added
|
|
op.d = '' // stop it being added
|
|
|
} else {
|
|
} else {
|
|
|
- if (fixedRemoveChange) {
|
|
|
|
|
- this._removeChange(change)
|
|
|
|
|
- } else {
|
|
|
|
|
- this._brokenRemoveChange(change)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this._removeChange(change)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -637,11 +627,7 @@ class RangesTracker {
|
|
|
const results = this._scanAndMergeAdjacentUpdates()
|
|
const results = this._scanAndMergeAdjacentUpdates()
|
|
|
movedChanges = movedChanges.concat(results.movedChanges)
|
|
movedChanges = movedChanges.concat(results.movedChanges)
|
|
|
for (const change of results.removeChanges) {
|
|
for (const change of results.removeChanges) {
|
|
|
- if (fixedRemoveChange) {
|
|
|
|
|
- this._removeChange(change)
|
|
|
|
|
- } else {
|
|
|
|
|
- this._brokenRemoveChange(change)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this._removeChange(change)
|
|
|
movedChanges = movedChanges.filter(c => c !== change)
|
|
movedChanges = movedChanges.filter(c => c !== change)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -683,11 +669,6 @@ class RangesTracker {
|
|
|
this._markAsDirty(change, 'change', 'removed')
|
|
this._markAsDirty(change, 'change', 'removed')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- _brokenRemoveChange(change) {
|
|
|
|
|
- this.changes = this.changes.filter(c => c.id !== change.id)
|
|
|
|
|
- this._markAsDirty(change, 'change', 'removed')
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
_applyOpModifications(content, opModifications) {
|
|
_applyOpModifications(content, opModifications) {
|
|
|
// Put in descending position order, with deleting first if at the same offset
|
|
// Put in descending position order, with deleting first if at the same offset
|
|
|
// (Inserting first would modify the content that the delete will delete)
|
|
// (Inserting first would modify the content that the delete will delete)
|