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 #192 from ckeditor/t/191
Browse files Browse the repository at this point in the history
Other: Use `model.insertContent` instead of `model.Writer#insertText`. Closes #191.
  • Loading branch information
Piotr Jasiun authored May 20, 2019
2 parents c5cdc16 + 68e1af6 commit 0aeb384
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 0aeb384

Please sign in to comment.