Browse Source

Aligned code to new `Writer#setSelection` API.

Maciej Bukowski 7 years ago
parent
commit
f9a142a970

+ 1 - 1
packages/ckeditor5-undo/src/basecommand.js

@@ -112,7 +112,7 @@ export default class BaseCommand extends Command {
 		// `selectionRanges` may be empty if all ranges ended up in graveyard. If that is the case, do not restore selection.
 		if ( selectionRanges.length ) {
 			model.change( writer => {
-				writer.setSelection( selectionRanges, isBackward );
+				writer.setSelection( selectionRanges, { backward: isBackward } );
 			} );
 		}
 	}

+ 1 - 1
packages/ckeditor5-undo/tests/redocommand.js

@@ -70,7 +70,7 @@ describe( 'RedoCommand', () => {
 				 */
 				// Let's make things spicy and this time, make a backward selection.
 				model.change( writer => {
-					writer.setSelection( r( 2, 4 ), true );
+					writer.setSelection( r( 2, 4 ), { backward: true } );
 				} );
 				batch1 = new Batch();
 				undo.addBatch( batch1 );

+ 1 - 1
packages/ckeditor5-undo/tests/undocommand.js

@@ -60,7 +60,7 @@ describe( 'UndoCommand', () => {
 				 */
 				// Let's make things spicy and this time, make a backward selection.
 				model.change( writer => {
-					writer.setSelection( r( 2, 4 ), true );
+					writer.setSelection( r( 2, 4 ), { backward: true } );
 				} );
 				batch1 = new Batch();
 				undo.addBatch( batch1 );