8
0
Просмотр исходного кода

Changed: Minor refactoring making code more clear.

Szymon Cofalik 8 лет назад
Родитель
Сommit
50aa2838da
1 измененных файлов с 3 добавлено и 1 удалено
  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;