From 68e1af62e01bca939e073a41ee780313c7cdb8b7 Mon Sep 17 00:00:00 2001 From: Szymon Cofalik Date: Mon, 20 May 2019 12:48:42 +0200 Subject: [PATCH] Other: Use `model.insertContent` instead of `model.Writer#insertText`. --- src/inputcommand.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/inputcommand.js b/src/inputcommand.js index 28465e8..458c93e 100644 --- a/src/inputcommand.js +++ b/src/inputcommand.js @@ -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 ) {