Inez has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/59331


Change subject: Make returning the same offset the least preferred option in 
ve.ce.Document.getRelativeOffset
......................................................................

Make returning the same offset the least preferred option in 
ve.ce.Document.getRelativeOffset

Change-Id: If21cdea220b58aec92b8735e92f594d8c16c8f6f
---
M modules/ve/ce/ve.ce.Document.js
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/31/59331/1

diff --git a/modules/ve/ce/ve.ce.Document.js b/modules/ve/ce/ve.ce.Document.js
index 120571a..f14b910 100644
--- a/modules/ve/ce/ve.ce.Document.js
+++ b/modules/ve/ce/ve.ce.Document.js
@@ -94,7 +94,10 @@
                // Check if we've moved into a slug
                if ( !!this.getSlugAtOffset( relativeStructuralOffset ) ) {
                        // Check if the relative content offset is in the 
opposite direction we are trying to go
-                       if ( ( relativeContentOffset - offset < 0 ? -1 : 1 ) 
!== bias ) {
+                       if (
+                               relativeContentOffset === offset ||
+                               ( relativeContentOffset - offset < 0 ? -1 : 1 ) 
!== bias
+                       ) {
                                // There's nothing past the slug we are already 
in, stay in it
                                return relativeStructuralOffset;
                        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If21cdea220b58aec92b8735e92f594d8c16c8f6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Inez <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to