Parcourir la source

Changed: Minor refactoring making code more clear.

Szymon Cofalik il y a 8 ans
Parent
commit
50aa2838da
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      packages/ckeditor5-engine/src/model/operation/transform.js

+ 3 - 1
packages/ckeditor5-engine/src/model/operation/transform.js

@@ -342,7 +342,9 @@ const ot = {
 		InsertOperation( a, b, context ) {
 			// Create range from MoveOperation properties and transform it by insertion.
 			let range = Range.createFromPositionAndShift( a.sourcePosition, a.howMany );
-			range = range._getTransformedByInsertion( b.position, b.nodes.maxOffset, false, a.isSticky && !context.forceNotSticky )[ 0 ];
+			const includeB = a.isSticky && !context.forceNotSticky;
+
+			range = range._getTransformedByInsertion( b.position, b.nodes.maxOffset, false, includeB )[ 0 ];
 
 			// Check whether there is a forced order of nodes or use `context.isStrong` flag for conflict resolving.
 			const insertBefore = context.insertBefore === undefined ? !context.isStrong : context.insertBefore;