This repository was archived by the owner on Jun 26, 2020. It is now read-only.
File tree 2 files changed +48
-3
lines changed
tests/model/operation/transform
2 files changed +48
-3
lines changed Original file line number Diff line number Diff line change @@ -1317,13 +1317,11 @@ export default class Writer {
1317
1317
let isAffected = false ;
1318
1318
1319
1319
if ( type == 'move' ) {
1320
- const intersecting =
1320
+ isAffected =
1321
1321
positionOrRange . containsPosition ( markerRange . start ) ||
1322
1322
positionOrRange . start . isEqual ( markerRange . start ) ||
1323
1323
positionOrRange . containsPosition ( markerRange . end ) ||
1324
1324
positionOrRange . end . isEqual ( markerRange . end ) ;
1325
-
1326
- isAffected = intersecting && ! positionOrRange . containsRange ( markerRange ) ;
1327
1325
} else {
1328
1326
// if type == 'merge'.
1329
1327
const elementBefore = positionOrRange . nodeBefore ;
Original file line number Diff line number Diff line change @@ -527,4 +527,51 @@ describe( 'transform', () => {
527
527
'<paragraph>B<m1:end></m1:end>ar</paragraph>'
528
528
) ;
529
529
} ) ;
530
+
531
+ // https://github.com/ckeditor/ckeditor5-engine/issues/1668
532
+ it ( 'marker and moves with undo-redo-undo' , ( ) => {
533
+ john . setData ( '<paragraph>X[]Y</paragraph>' ) ;
534
+
535
+ const inputBufferBatch = john . editor . commands . get ( 'input' ) . buffer . batch ;
536
+
537
+ john . editor . model . enqueueChange ( inputBufferBatch , ( ) => {
538
+ john . type ( 'a' ) ;
539
+ john . type ( 'b' ) ;
540
+ john . type ( 'c' ) ;
541
+
542
+ john . setSelection ( [ 0 , 1 ] , [ 0 , 4 ] ) ;
543
+ john . setMarker ( 'm1' ) ;
544
+ } ) ;
545
+
546
+ expectClients ( '<paragraph>X<m1:start></m1:start>abc<m1:end></m1:end>Y</paragraph>' ) ;
547
+
548
+ john . setSelection ( [ 0 , 0 ] , [ 0 , 5 ] ) ;
549
+ john . _processExecute ( 'delete' ) ;
550
+
551
+ expectClients ( '<paragraph></paragraph>' ) ;
552
+
553
+ john . undo ( ) ;
554
+
555
+ expectClients ( '<paragraph>X<m1:start></m1:start>abc<m1:end></m1:end>Y</paragraph>' ) ;
556
+
557
+ john . undo ( ) ;
558
+
559
+ expectClients ( '<paragraph>XY</paragraph>' ) ;
560
+
561
+ john . redo ( ) ;
562
+
563
+ expectClients ( '<paragraph>X<m1:start></m1:start>abc<m1:end></m1:end>Y</paragraph>' ) ;
564
+
565
+ john . redo ( ) ;
566
+
567
+ expectClients ( '<paragraph></paragraph>' ) ;
568
+
569
+ john . undo ( ) ;
570
+
571
+ expectClients ( '<paragraph>X<m1:start></m1:start>abc<m1:end></m1:end>Y</paragraph>' ) ;
572
+
573
+ john . undo ( ) ;
574
+
575
+ expectClients ( '<paragraph>XY</paragraph>' ) ;
576
+ } ) ;
530
577
} ) ;
You can’t perform that action at this time.
0 commit comments