Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1584 from ckeditor/t/1583
Browse files Browse the repository at this point in the history
Fix: Made markers created by `Writer#insert()` affect data. Closes #1583.
  • Loading branch information
oskarwrobel authored Oct 24, 2018
2 parents f88c918 + c478a3e commit 72aaaf0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/model/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export default class Writer {
markerRange.end._getCombined( rangeRootPosition, position )
);

this.addMarker( markerName, { range, usingOperation: true } );
this.addMarker( markerName, { range, usingOperation: true, affectsData: true } );
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion tests/model/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,13 @@ describe( 'Writer', () => {

expect( Array.from( model.markers ).length ).to.equal( 1 );

const range = model.markers.get( 'marker' ).getRange();
const modelMarker = model.markers.get( 'marker' );
const range = modelMarker.getRange();
expect( range.root ).to.equal( root );
expect( range.start.path ).to.deep.equal( [ 2, 1 ] );
expect( range.end.path ).to.deep.equal( [ 2, 5 ] );
expect( modelMarker.managedUsingOperations ).to.be.true;
expect( modelMarker.affectsData ).to.be.true;
} );

it( 'should throw when trying to use detached writer', () => {
Expand Down

0 comments on commit 72aaaf0

Please sign in to comment.