-
Notifications
You must be signed in to change notification settings - Fork 167
Operation Transform Concepts
Philip Peitsch edited this page Apr 27, 2015
·
1 revision
- Reduce amount of repeated logic in OT matrix
- AND, provide more structured approach to OT to minimise unnecessary variations
- AND, make OTs easier to implement and review
Name | Modifies step count | Has attached region | Special cases |
---|---|---|---|
AddAnnotation | insertSteps (+2) | Sometimes (length !== undefined) | |
MergeParagraph | removeStep (-1) | Yes (source + dest p's) | |
MoveCursor | No | Sometimes (length > 0) | |
RemoveText | removeSteps (-length) | No | * RemoveText can't span paragraph boundaries |
SplitParagraph | insertStep (+1) | Yes (source p + split point) | * MergeParagraph (source + destination positions are first step in respective paragraph) |
- A single operation can only insert or remove steps at a single point in the document
- An operation can be described as an insert/remove THEN region apply
For ease of understanding, all cases are presented from the perspective of opA
transforming opB
. Each of these rules are presented as a general case, meaning that the rule applies, but may be extended by further, more specialised rules.
- WHEN
opA
doesn't modify step count, THEN do not transformopB
- WHEN
opA
inserts/removes one or more steps - WHEN
opA
is beforeopB
, THEN moveopB
start position - WHEN
opA
is onopB
start boundary, THEN ... - WHEN
opA
is withinopB
, THEN ... - WHEN
opA
is onopB
end boundary, THEN ... - WHEN
opA
is afteropB
, THEN do not transformopB