Page MenuHomePhabricator

Ctrl+Shift+Space inserts links in VisualEditor
Closed, ResolvedPublicBUG REPORT

Description

If you happen to use Ctrl+Shift+Space (feature introduced after T53045) in linked text, any subsequent use of this combination in other place will result in insertion of   with this particular link. Such behavior makes this feature practically unusable inside linked text. Errors resulting from its usage are very hard to notice without checking the source code, because it's impossible to distinguish a wikilink-containing space visually.

Steps to replicate the issue:

  • Set the pointer inside an internal or external link in VisualEditor
  • Press Ctrl+Shift+Space
  • Set the pointer outside this link
  • Press Ctrl+Shift+Space

What happens?:

If the first edited link was [https://example.com Example], subsequent use inserts the code [https://example.com &nbsp;]. If it was [[Example]] (or a piped link), it inserts the code [[Example|&nbsp;]]<nowiki/>.

What should have happened instead?:

Non-breaking space is inserted.

Event Timeline

I cannot reproduce this on a mac (where it's option-shift-space):

CleanShot 2026-05-29 at 08.37.02@2x.png (866×588 px, 133 KB)

(That said, separate issue, it's a bit weird that we're not covering the nbsp in the link-annotation when it's done in the middle of a link.)

it's a bit weird that we're not covering the nbsp in the link-annotation when it's done in the middle of a link.

It seems broken for you in a different way, for me it works as expected inside links: [[1 2]] becomes [[1 2|1&nbsp;2]]

Apparently we handle NBSP very differently on Mac and Windows.

On Windows, Ctrl+Shift+Space is handled as a trigger combination in VE, configured to insert the entity: https://gerrit.wikimedia.org/g/mediawiki/extensions/VisualEditor/+/64c84afd2a4af12bdad32953ed6e08098bee4e04/modules/ve-mw/ui/ve.ui.MWCommandRegistry.js#26. I can reproduce @Qbli2mHd's experience (and you can probably reproduce it on a Mac by adding a Mac trigger there).

On Mac, there is no trigger, since there is a native key combination to insert it. Instead we have special handling to replace plain text non-breaking spaces when they are input this way: https://gerrit.wikimedia.org/g/VisualEditor/VisualEditor/+/e0145fceaee8ab41da86990ac37068f962828a5d/src/ce/ve.ce.Surface.js#1939. I can reproduce @DLynch's experience on Windows too by using Alt+0160 to input a non-breaking space (see Alt codes).

Change #1295493 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[VisualEditor/VisualEditor@master] Fix problems with annotations on non-breaking spaces

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

I confirm that this bug is at least on Windows (10). Sometning similar also happens when you Ctrl+C a non-breaking space inside a wikilink and then Ctrl+V it somewhere else: video (Opera GX), page. It's highly unlikely that the user actually wants to paste [[Monkey Island|&nbsp;]]. They most likely want to just insert the nbsp.

Change #1295493 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Fix problems with annotations when inserting non-breaking spaces

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

Change #1295877 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (35c6564c9)

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

Change #1295877 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (35c6564c9)

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

@matmarex, thanks! When will the fix take effect? I'm personally still experiencing the bug.

Depends a little on which wiki you edit on. It'll be on the deployment train, so at latest you should see the fix on Thursday.