Bladeren bron

Code refactoring in the bindTwoStepCaretToAttribute helper.

Aleksander Nowodzinski 7 jaren geleden
bovenliggende
commit
975b22feab
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      packages/ckeditor5-engine/src/utils/bindtwostepcarettoattribute.js

+ 2 - 2
packages/ckeditor5-engine/src/utils/bindtwostepcarettoattribute.js

@@ -350,7 +350,7 @@ class TwoStepCaretHandler {
 			// 		<paragraph><$text attribute>bar{}</$text></paragraph>
 			// 		<paragraph><$text attribute>bar</$text>{}</paragraph>
 			//
-			if ( position.isAtEnd && isAtBoundary( position, attribute ) ) {
+			if ( position.isAtEnd && isAtEndBoundary( position, attribute ) ) {
 				// DON'T ENGAGE 2-SCM if gravity is already overridden. The selection has the attribute already.
 				// This is a common selection if set using the mouse.
 				//
@@ -377,7 +377,7 @@ class TwoStepCaretHandler {
 			//
 			// 		<paragraph>{}<$text attribute>bar</$text></paragraph>
 			//
-			if ( position.isAtStart && isAtBoundary( position, attribute ) ) {
+			if ( position.isAtStart ) {
 				if ( this._hasSelectionAttribute ) {
 					this._removeSelectionAttribute();
 				}