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

Commit

Permalink
Merge pull request #68 from ckeditor/i/6072
Browse files Browse the repository at this point in the history
Other: Added fix for track changes. Closes ckeditor/ckeditor5#6072.
  • Loading branch information
scofalik authored Jan 14, 2020
2 parents 500d9c8 + a191306 commit 4848bcb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/shiftentercommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function softBreakAction( model, writer, selection ) {

if ( isSelectionEmpty ) {
const attributesToCopy = getCopyOnEnterAttributes( model.schema, selection.getAttributes() );
insertBreak( writer, range.end );
insertBreak( model, writer, range.end );

writer.removeSelectionAttribute( selection.getAttributeKeys() );
writer.setSelectionAttribute( attributesToCopy );
Expand All @@ -95,7 +95,7 @@ function softBreakAction( model, writer, selection ) {
//
// <h>x[xx]x</h> -> <h>x^x</h> -> <h>x<br>^x</h>
if ( isContainedWithinOneElement ) {
insertBreak( writer, selection.focus );
insertBreak( model, writer, selection.focus );
}
// Selection over multiple elements.
//
Expand All @@ -116,10 +116,10 @@ function softBreakAction( model, writer, selection ) {
}
}

function insertBreak( writer, position ) {
function insertBreak( model, writer, position ) {
const breakLineElement = writer.createElement( 'softBreak' );

writer.insert( breakLineElement, position );
model.insertContent( breakLineElement, position );
writer.setSelection( breakLineElement, 'after' );
}

Expand Down

0 comments on commit 4848bcb

Please sign in to comment.