Jforrester has uploaded a new change for review.

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

Change subject: Only showSelection if checkSequences actually matched something
......................................................................

Only showSelection if checkSequences actually matched something

The unconditional showSelection in ve.ce.Surface checkSequences was breaking
most IMEs, because it removes the existing selection, which closes the
candidate window.

We are still calling checkSequences at a time when we are not certain it is
IME-safe to make changes, but in practice this is probably less dangerous,
because for most common IMEs there will be no candidate when one of the
currently recognized sequences matches.

Applying the model selection under setTimeout can conflict with IMEs that
cause multiple events in a single tick. This does happen in practice, e.g.
typing ASCII from within Korean IME, but it is an edge case and the fix is
more complex. We should investigate whether ve.EventSequencer afterLoopOne can
make this safer.

Change-Id: Id89e84b5deb818ff4f978ac13e75cf70880df7f0
(cherry picked from commit 02d3a2762a78f0e4541742b73f3f51f737283600)
---
M src/ce/ve.ce.Surface.js
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/29/176129/1

diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index b39730c..2154f5a 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -2346,7 +2346,9 @@
        for ( i = 0; i < sequences.length; i++ ) {
                sequences[i].execute( this.surface );
        }
-       this.showSelection( this.surface.getModel().getSelection() );
+       if ( sequences.length > 0 ) {
+               this.showSelection( this.surface.getModel().getSelection() );
+       }
 };
 
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id89e84b5deb818ff4f978ac13e75cf70880df7f0
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: wmf/1.25wmf10
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Divec <[email protected]>

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

Reply via email to