Catrope has uploaded a new change for review.

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


Change subject: Intiialize selection at (1,1) instead of (0,0)
......................................................................

Intiialize selection at (1,1) instead of (0,0)

Code with a similar purpose was added in 568e0e5701 but got lost
when some things were moved from ve.Surface to ve.ce.Surface in
5012ed10.

Initializing the selection at (0,0) was known to cause problems before,
and since 789d0caf093b breaks editing of empty documents: typing in an
empty document begins in an inline slug, but SurfaceObserver doesn't
notice typing in an inline slug unless the ce.Surface pawns it, which
is OK because insertions in slugs are always pawned, but the pawning
logic believes the cursor to be at offset 0 where there is no slug
(it's at offset 1) and so it doesn't pawn.

Change-Id: Id72314d0fe650dacc7cdb842f5cea2f3bfba5145
---
M modules/ve/dm/ve.dm.Surface.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/ve/dm/ve.dm.Surface.js b/modules/ve/dm/ve.dm.Surface.js
index 735da78..b6aec21 100644
--- a/modules/ve/dm/ve.dm.Surface.js
+++ b/modules/ve/dm/ve.dm.Surface.js
@@ -21,7 +21,7 @@
        // Properties
        this.documentModel = doc;
        this.metaList = new ve.dm.MetaList( this );
-       this.selection = new ve.Range( 0, 0 );
+       this.selection = new ve.Range( 1, 1 );
        this.selectedNodes = {};
        this.smallStack = [];
        this.bigStack = [];

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

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

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

Reply via email to