jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/405833 )
Change subject: SurfaceSynchronizer: Also translate selections that are not
mentioned in the change
......................................................................
SurfaceSynchronizer: Also translate selections that are not mentioned in the
change
Otherwise, if a lot of content gets deleted, other authors' selections
will become out of bounds.
Change-Id: Ie1e1ac4385abf7bdf78b1f40c9394a001ae2f182
---
M src/dm/ve.dm.SurfaceSynchronizer.js
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Divec: Looks good to me, approved
jenkins-bot: Verified
diff --git a/src/dm/ve.dm.SurfaceSynchronizer.js
b/src/dm/ve.dm.SurfaceSynchronizer.js
index 651f952..0f51f1b 100644
--- a/src/dm/ve.dm.SurfaceSynchronizer.js
+++ b/src/dm/ve.dm.SurfaceSynchronizer.js
@@ -142,6 +142,9 @@
change.applyTo( this.surface );
// HACK: After applyTo(), the selections are wrong and applying them
could crash.
// The only reason this doesn't happen is because everything that tries
to do that uses setTimeout().
+ // Translate the selections that aren't going to be overwritten by
change.selections
+ this.applyNewSelections( this.authorSelections, change );
+ // Apply the overwrites from change.selections
this.applyNewSelections( change.selections );
};
@@ -241,6 +244,7 @@
translatedSelection = newSelections[ authorId ];
}
if ( !translatedSelection.equals( this.authorSelections[
authorId ] ) ) {
+ // This works correctly even if newSelections ===
this.authorSelections
this.authorSelections[ authorId ] = translatedSelection;
this.emit( 'authorSelect', authorId );
}
--
To view, visit https://gerrit.wikimedia.org/r/405833
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie1e1ac4385abf7bdf78b1f40c9394a001ae2f182
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Divec <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits