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

Commit

Permalink
Other: Use model.insertContent instead of model.Writer#insertText.
Browse files Browse the repository at this point in the history
  • Loading branch information
scofalik authored and Reinmar committed Jun 5, 2019
1 parent 4f00f79 commit a9a15b3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/inputcommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ export default class InputCommand extends Command {

this._buffer.lock();

if ( !isCollapsedRange ) {
model.deleteContent( model.createSelection( range ) );
}
model.deleteContent( model.createSelection( range ) );

if ( text ) {
writer.insertText( text, doc.selection.getAttributes(), range.start );
model.insertContent( writer.createText( text, doc.selection.getAttributes() ), range.start );
}

if ( resultRange ) {
Expand Down

0 comments on commit a9a15b3

Please sign in to comment.