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

Used forceWeakRemove flag in undo OT #96

Merged
merged 2 commits into from
Feb 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/basecommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ export default class BaseCommand extends Command {
{
useRelations: true,
document: this.editor.model.document,
padWithNoOps: false
padWithNoOps: false,
forceWeakRemove: true
}
);

Expand Down
7 changes: 0 additions & 7 deletions tests/undocommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,6 @@ describe( 'UndoCommand', () => {
for ( const item of model.createRangeIn( doc.graveyard ).getItems() ) {
expect( item.hasAttribute( 'key' ) ).to.be.false;
}

// Let's undo wrapping. This will remove the P element and leave us with empty root.
undo.execute( batch3 );
expect( root.maxOffset ).to.equal( 0 );

expect( editor.model.document.selection.getFirstRange().isEqual( r( 0, 0 ) ) ).to.be.true;
expect( editor.model.document.selection.isBackward ).to.be.false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remove this part of the test because it started to fail. Unfortunately, this part is about more complex OT of "unwrap action". Since we removed WrapOperation and UnwrapOperation we no longer can provide fixes for such scenario.

It was working before "by accident" due to a bug in a different pair of transformations.

} );

it( 'should omit deltas with non-document operations', () => {
Expand Down