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

Commit

Permalink
Internal: DataController#deleteContent node merging is now a default …
Browse files Browse the repository at this point in the history
…behaviour. Closes #97.
  • Loading branch information
szymonkups committed Jun 28, 2017
2 parents fb51301 + a919c94 commit 958eeb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/deletecommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default class DeleteCommand extends Command {
);
} );

dataController.deleteContent( selection, this._buffer.batch, { merge: true } );
dataController.deleteContent( selection, this._buffer.batch );
this._buffer.input( changeCount );

doc.selection.setRanges( selection.getRanges(), selection.isBackward );
Expand Down
11 changes: 10 additions & 1 deletion tests/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import ViewSelection from '@ckeditor/ckeditor5-engine/src/view/selection';
import EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';
import { getCode } from '@ckeditor/ckeditor5-utils/src/keyboard';

import { getData as getModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
import { getData as getModelData, setData as setModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
import { getData as getViewData } from '@ckeditor/ckeditor5-engine/src/dev-utils/view';

describe( 'Input feature', () => {
Expand Down Expand Up @@ -386,6 +386,15 @@ describe( 'Input feature', () => {
ModelRange.createFromParentsAndOffsets( modelRoot.getChild( 0 ), 2, modelRoot.getChild( 0 ), 4 ) ] );
} );

listenter.listenTo( view, 'keydown', () => {
expect( getModelData( model ) ).to.equal( '<paragraph>fo[]ar</paragraph>' );
}, { priority: 'lowest' } );
} );

// #97
it( 'should remove contents and merge blocks', () => {
setModelData( model, '<paragraph>fo[o</paragraph><paragraph>b]ar</paragraph>' );

listenter.listenTo( view, 'keydown', () => {
expect( getModelData( model ) ).to.equal( '<paragraph>fo[]ar</paragraph>' );

Expand Down

0 comments on commit 958eeb2

Please sign in to comment.