Page MenuHomePhabricator

NWE produces newline when selecting, copying and immediatly re-pasting text
Closed, ResolvedPublic

Description

As reported on the German-language Wikipedia's feedback page, the NWE adds a newline when a line of text is selected in its entirety, copied, and immediately pasted without changing the selected region.

Steps to reproduce:

  1. Open an article with the 2017 Wikitext Editor
  2. Find a list or create a new list (It is not important whether it is a list or not, but it is easiest to see this way)
  3. Place the cursor at the very front of a line in the middle of a list
  4. Press the left mouse-button (to select the text) and move down the cursor to the start of next line (alternatively, place the cursor, hold shift, and press arrow-down)
  5. Copy the text using Ctrl + C
  6. Without moving the cursor, paste the text using Ctrl + V

Expected: Nothing changes, the text is replaced with itself

Actual: A new line is inserted below the cursor

While it makes sense that by selecting the text as described, the linebreak is included in the selection, text editors usually do not behave this way, because they will replace the linebreak with a linebreak. You can test this right here in Phabricator, or in an editor such as Notepad++, or Microsoft Word.

Event Timeline

Cirdan created this task.Jul 9 2018, 6:21 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptJul 9 2018, 6:21 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Cirdan updated the task description. (Show Details)Jul 9 2018, 6:24 PM
DLynch added a subscriber: DLynch.Jul 12 2018, 4:09 PM

Sorry, do you mean a surplus new line is added in addition to the one you copied? The behavior you describe, as I read it, is what I'd expect from a text editor.

E.g. here's what you describe in Phabricator:

And here it is in NWE:

I see no difference in behavior.

Also behaves correctly for me.

No, the video doesn't show the problem, although from what I can tell you exactly reproduce the steps. However, the problem seems to be gone, which is quite strange. I will ask the two users who reported the problem in the first place to check.

What happened was that

* item
* item 
* item

turned into

* item 
* item

* item

when the middle item was selected/copied/pasted as I wrote above.

Yes, the problem is gone! :) Thanks to whoever solved it!

Deskana closed this task as Resolved.Jul 13 2018, 9:20 AM
Deskana claimed this task.
Deskana triaged this task as Normal priority.
Deskana added a subscriber: Deskana.

Sometimes problems are transient. I guess this is an example of that. :-)

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptJul 13 2018, 9:20 AM