jenkins-bot has submitted this change and it was merged.

Change subject: Getting rid of ve.splitClusters in VE core
......................................................................


Getting rid of ve.splitClusters in VE core

Bug: 57628
Change-Id: I65d4c58466c486c3eae8399a26a362c2a79586a5
---
M src/ce/ve.ce.Surface.js
M src/dm/ve.dm.Converter.js
M src/dm/ve.dm.SurfaceFragment.js
M src/ui/inspectors/ve.ui.AnnotationInspector.js
M src/ve.js
5 files changed, 6 insertions(+), 15 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index 541a9c8..8e53b5a 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -1705,8 +1705,8 @@
                fromLeft = 0,
                fromRight = 0,
                nodeOffset = node.getModel().getOffset(),
-               previousData = ve.splitClusters( previous.text ),
-               nextData = ve.splitClusters( next.text ),
+               previousData = previous.text.split( '' ),
+               nextData = next.text.split( '' ),
                lengthDiff = next.text.length - previous.text.length,
                nextDataString = new ve.dm.DataString( nextData ),
                surface = this;
@@ -1787,7 +1787,7 @@
 
                // Simple insertion
                if ( lengthDiff > 0 && offsetDiff === lengthDiff /* && 
sameLeadingAndTrailing */) {
-                       data = ve.splitClusters( next.text ).slice( 
previousStart, nextStart );
+                       data = nextData.slice( previousStart, nextStart );
                        // Apply insertion annotations
                        annotations = this.model.getInsertionAnnotations();
                        if ( annotations.getLength() ) {
diff --git a/src/dm/ve.dm.Converter.js b/src/dm/ve.dm.Converter.js
index 4a173ba..1f05211 100644
--- a/src/dm/ve.dm.Converter.js
+++ b/src/dm/ve.dm.Converter.js
@@ -49,7 +49,7 @@
  */
 ve.dm.Converter.getDataContentFromText = function ( text, annotations ) {
        var i, len,
-               characters = ve.splitClusters( text );
+               characters = text.split( '' );
 
        if ( !annotations || annotations.isEmpty() ) {
                return characters;
diff --git a/src/dm/ve.dm.SurfaceFragment.js b/src/dm/ve.dm.SurfaceFragment.js
index ef757d5..385a6b0 100644
--- a/src/dm/ve.dm.SurfaceFragment.js
+++ b/src/dm/ve.dm.SurfaceFragment.js
@@ -709,7 +709,7 @@
        offset = this.getSelection( true ).getRange().start;
        // Auto-convert content to array of plain text characters
        if ( typeof content === 'string' ) {
-               content = ve.splitClusters( content );
+               content = content.split( '' );
        }
        if ( content.length ) {
                if ( annotate ) {
diff --git a/src/ui/inspectors/ve.ui.AnnotationInspector.js 
b/src/ui/inspectors/ve.ui.AnnotationInspector.js
index 860cc10..c6a38a2 100644
--- a/src/ui/inspectors/ve.ui.AnnotationInspector.js
+++ b/src/ui/inspectors/ve.ui.AnnotationInspector.js
@@ -68,7 +68,7 @@
  * @returns {Array} Linear model content to insert
  */
 ve.ui.AnnotationInspector.prototype.getInsertionData = function () {
-       return ve.splitClusters( this.getInsertionText() );
+       return this.getInsertionText().split( '' );
 };
 
 /**
diff --git a/src/ve.js b/src/ve.js
index 5d00abf..2a45179 100644
--- a/src/ve.js
+++ b/src/ve.js
@@ -400,15 +400,6 @@
        };
 
        /**
-        * Compatibility method. We no longer split into clusters at this level.
-        *
-        * TODO: strip out calls to splitClusters then delete this method.
-        */
-       ve.splitClusters = function ( text ) {
-               return text.split( '' );
-       };
-
-       /**
         * Determine if the text consists of only unattached combining marks.
         *
         * @param {string} text Text to test

-- 
To view, visit https://gerrit.wikimedia.org/r/165433
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I65d4c58466c486c3eae8399a26a362c2a79586a5
Gerrit-PatchSet: 3
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: SuchetaG <sucheta.ghos...@gmail.com>
Gerrit-Reviewer: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to