Skip to content

OT improvements for undo in pasting scenarios #4497

Closed
ckeditor/ckeditor5-engine
#1702
@scofalik

Description

@scofalik

I discovered an error concerning undo in a scenario with paste and delete.

This test doesn't pass:

john.setData( '<paragraph>Ab[]cd</paragraph><paragraph>Wxyz</paragraph>' );

john.editor.model.insertContent(
	new DocumentFragment( [
		new Element( 'paragraph', null, new Text( 'Foo' ) ),
		new Element( 'paragraph', null, new Text( 'Bar' ) )
	] )
);

john.setSelection( [ 1, 3 ], [ 2, 2 ] );

john._processExecute( 'delete' );

expectClients( '<paragraph>AbFoo</paragraph><paragraph>Baryz</paragraph>' );

john.undo();

expectClients( '<paragraph>AbFoo</paragraph><paragraph>Barcd</paragraph><paragraph>Wxyz</paragraph>' );

john.undo();

expectClients( '<paragraph>Abcd</paragraph><paragraph>Wxyz</paragraph>' );

There are two problems, with split x split transformation and merge x split transformation. These are some edge cases that weren't yet covered in OT.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions