-
Notifications
You must be signed in to change notification settings - Fork 40
Additional improvements in OT #1498
Conversation
…dn't really move any nodes.
…es that have boundaries in different roots.
@@ -30,12 +30,13 @@ export default class MergeOperation extends Operation { | |||
* | |||
* @param {module:engine/model/position~Position} sourcePosition Position inside the merged element. All nodes from that | |||
* element after that position will be moved to {@link ~#targetPosition}. | |||
* @param {Number} howMany |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs?
src/model/operation/transform.js
Outdated
|
||
updateRelations( context, opA, opB ); | ||
} | ||
for ( let j = transformFrom; j < operationsB.length; ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we talked it could be simplified.
src/model/operation/transform.js
Outdated
// | ||
// So, the final solution is to just expand the original range, but "fix" all the nodes that have "incorrect" `oldValue`. | ||
// For example, in the highlight case above, we would need an operation to change `highlight="red"` to `null` so that | ||
// the original attribute operation `null` -> `yellow` would be correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An example is needed here.
src/model/operation/transform.js
Outdated
// Unwrap: | ||
// <p>Foo</p><p>Bar</p><p>Xyz</p> | ||
// | ||
// Wrap with stronger wrap (`a`): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"(a
)" can be removed or replaced with "(strong operation A)".
src/model/operation/transform.js
Outdated
@@ -77,6 +79,10 @@ export function transformSets( operationsA, operationsB, options ) { | |||
return { operationsA, operationsB }; | |||
} | |||
|
|||
for ( const op of operationsA ) { | |||
op.transformBy = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WeakMap?
Suggested merge commit message (convention)
Other: Added
MergeOperation#howMany
andSplitOperation#howMany
. Improvements inPosition
andRange
transforming functions. Improvements in OT algorithms. Closes ckeditor/ckeditor5#4394. Closes ckeditor/ckeditor5#4396. Closes ckeditor/ckeditor5#4398.