insertions must not be deleted anymore!
This commit is contained in:
parent
6fc33e40bb
commit
0a89150fab
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -416,7 +416,7 @@ module.exports = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Insert.prototype.applyDelete = function(o) {
|
Insert.prototype.applyDelete = function(o) {
|
||||||
var callLater, garbagecollect, ref;
|
var callLater, garbagecollect;
|
||||||
if (this.deleted_by == null) {
|
if (this.deleted_by == null) {
|
||||||
this.deleted_by = [];
|
this.deleted_by = [];
|
||||||
}
|
}
|
||||||
@ -435,7 +435,7 @@ module.exports = function() {
|
|||||||
if (callLater) {
|
if (callLater) {
|
||||||
this.parent.callOperationSpecificDeleteEvents(this, o);
|
this.parent.callOperationSpecificDeleteEvents(this, o);
|
||||||
}
|
}
|
||||||
if ((ref = this.prev_cl) != null ? ref.isDeleted() : void 0) {
|
if ((this.prev_cl != null) && this.prev_cl.isDeleted()) {
|
||||||
return this.prev_cl.applyDelete();
|
return this.prev_cl.applyDelete();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -457,7 +457,7 @@ module.exports = function() {
|
|||||||
}
|
}
|
||||||
this.prev_cl.next_cl = this.next_cl;
|
this.prev_cl.next_cl = this.next_cl;
|
||||||
this.next_cl.prev_cl = this.prev_cl;
|
this.next_cl.prev_cl = this.prev_cl;
|
||||||
if (this.content instanceof ops.Operation) {
|
if (this.content instanceof ops.Operation && !(this.content instanceof ops.Insert)) {
|
||||||
this.content.referenced_by--;
|
this.content.referenced_by--;
|
||||||
if (this.content.referenced_by <= 0 && !this.content.is_deleted) {
|
if (this.content.referenced_by <= 0 && !this.content.is_deleted) {
|
||||||
this.content.applyDelete();
|
this.content.applyDelete();
|
||||||
|
18656
build/test/list-test.js
Normal file
18656
build/test/list-test.js
Normal file
File diff suppressed because one or more lines are too long
18352
build/test/object-test.js
Normal file
18352
build/test/object-test.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
18674
build/test/text-test.js
Normal file
18674
build/test/text-test.js
Normal file
File diff suppressed because one or more lines are too long
@ -366,7 +366,7 @@ module.exports = ()->
|
|||||||
# An insert operation is always positioned between two other insert operations.
|
# An insert operation is always positioned between two other insert operations.
|
||||||
# Internally this is realized as associative lists, whereby each insert operation has a predecessor and a successor.
|
# Internally this is realized as associative lists, whereby each insert operation has a predecessor and a successor.
|
||||||
# For the sake of efficiency we maintain two lists:
|
# For the sake of efficiency we maintain two lists:
|
||||||
# - The short-list (abbrev. sl) maintains only the operations that are not deleted
|
# - The short-list (abbrev. sl) maintains only the operations that are not deleted (unimplemented, good idea?)
|
||||||
# - The complete-list (abbrev. cl) maintains all operations
|
# - The complete-list (abbrev. cl) maintains all operations
|
||||||
#
|
#
|
||||||
class ops.Insert extends ops.Operation
|
class ops.Insert extends ops.Operation
|
||||||
@ -425,7 +425,7 @@ module.exports = ()->
|
|||||||
super garbagecollect
|
super garbagecollect
|
||||||
if callLater
|
if callLater
|
||||||
@parent.callOperationSpecificDeleteEvents(this, o)
|
@parent.callOperationSpecificDeleteEvents(this, o)
|
||||||
if @prev_cl?.isDeleted()
|
if @prev_cl? and @prev_cl.isDeleted()
|
||||||
# garbage collect prev_cl
|
# garbage collect prev_cl
|
||||||
@prev_cl.applyDelete()
|
@prev_cl.applyDelete()
|
||||||
|
|
||||||
@ -451,7 +451,8 @@ module.exports = ()->
|
|||||||
# (e.g. the following operation order must be invertible :
|
# (e.g. the following operation order must be invertible :
|
||||||
# Insert refers to content, then the content is deleted)
|
# Insert refers to content, then the content is deleted)
|
||||||
# Therefore, we have to do this in the cleanup
|
# Therefore, we have to do this in the cleanup
|
||||||
if @content instanceof ops.Operation
|
# * NODE: We never delete Insertions!
|
||||||
|
if @content instanceof ops.Operation and not (@content instanceof ops.Insert)
|
||||||
@content.referenced_by--
|
@content.referenced_by--
|
||||||
if @content.referenced_by <= 0 and not @content.is_deleted
|
if @content.referenced_by <= 0 and not @content.is_deleted
|
||||||
@content.applyDelete()
|
@content.applyDelete()
|
||||||
|
@ -320,7 +320,7 @@ module.exports = ()->
|
|||||||
|
|
||||||
constructor: (custom_type, @_composition_value, composition_value_operations, uid, tmp_composition_ref)->
|
constructor: (custom_type, @_composition_value, composition_value_operations, uid, tmp_composition_ref)->
|
||||||
# we can't use @seveOperation 'composition_ref', tmp_composition_ref here,
|
# we can't use @seveOperation 'composition_ref', tmp_composition_ref here,
|
||||||
# because then there is a "loop" (insertion refers to parant, refers to insertion..)
|
# because then there is a "loop" (insertion refers to parent, refers to insertion..)
|
||||||
# This is why we have to check in @callOperationSpecificInsertEvents until we find it
|
# This is why we have to check in @callOperationSpecificInsertEvents until we find it
|
||||||
super custom_type, uid
|
super custom_type, uid
|
||||||
if tmp_composition_ref?
|
if tmp_composition_ref?
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user