Explorar o código

Merge pull request #192 from ckeditor/t/191

Other: Use `model.insertContent` instead of `model.Writer#insertText`. Closes #191.
Piotr Jasiun %!s(int64=6) %!d(string=hai) anos
pai
achega
3df962c87e
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  1. 2 4
      packages/ckeditor5-typing/src/inputcommand.js

+ 2 - 4
packages/ckeditor5-typing/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 ) {