-
Notifications
You must be signed in to change notification settings - Fork 166
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
opAdoesn't modify step count, THEN do not transformopB - WHEN
opAinserts/removes one or more steps - WHEN
opAis beforeopB, THEN moveopBstart position - WHEN
opAis onopBstart boundary, THEN ... - WHEN
opAis withinopB, THEN ... - WHEN
opAis onopBend boundary, THEN ... - WHEN
opAis afteropB, THEN do not transformopB