Page MenuHomePhabricator

Cursor off by several lines where the text is edited in new wikitext mode
Closed, ResolvedPublic

Description

Occasionally, I encounter problems while editing in the sourcetext. My cursor would be on one line, but the edits would take effect elsewhere in the text (usually the line above/below). I attached a screenshot, where the cursor is visible, and the two opening accolades ("{{") are on the line below.

I'm using Chrome on mac, have a number of extensions active, but never encountered this until I activated the new wikitext editor in the beta functions.

Screen Shot 2018-12-29 at 11.21.07 AM.png (1×1 px, 285 KB)

Event Timeline

This sounds a lot like T197592.

Very similar behavior for MacOS/Chrome in T202059 and T200741 which is closed as a duplicate of T56136.

Aklapper renamed this task from Cursor problems in new wikitext mode to Cursor off by several lines where the text is edited in new wikitext mode.Dec 29 2018, 2:44 PM

For the record, I can reproduce the error consistently through https://nl.wikipedia.org/w/index.php?title=Wikipedia:Te_beoordelen_pagina%27s/Toegevoegd_20181204&oldid=52879123&veaction=editsource currently. The error is still there if I add "&safemode=1" in the url. Let me know if there's more I can do to dig into what causes it.

It sounds a lot like T197592 indeed, but I don't see the similarity with T56136 (which predates the new wikitext editor beta?)

Schnark subscribed.

For me in Firefox there is no problem with that page.
A very wild guess: It's caused by the italic formatting (like T184467 was by bold). Can you test whether the issue is fixed by adding body .cm-em { font-style: normal; } as CSS? You can do so by oping the browser console and executing mw.util.addCSS('body .cm-em {font-style:normal;}').
Apart from that, there are currently T188839: When editing source, sometimes characters get put in strange places if you have too many characters on a line (due to space collapsing), T205689: NWE+CodeMirror: Notice about unflagged revision can cause different line breaks and T203638: Different widths in NWE+CodeMirror can cause text and color to fall out of sync open.

@Schnark I opened the edit window I linked above, opened the browser console, executed mw.util.addCSS('body .cm-em {font-style:normal;}') and then tried to type again without reloading. That did not solve it.

Same problem on french wikipedia. It occurs more often on these last days. It doesn't occur for now when I edit a whole page (the upper edit menu), but only when I edit a section of it (sections menus).

Same problem on french wikipedia. It occurs more often on these last days. It doesn't occur for now when I edit a whole page (the upper edit menu), but only when I edit a section of it (sections menus).

The recent regression is a separate problem, see T238678.

Effeietsanders claimed this task.

Error can no longer be reproduced in this page. Resolving.