addons-code-manager icon indicating copy to clipboard operation
addons-code-manager copied to clipboard

Copying multi-line string inserts newline between each line

Open wagnerand opened this issue 3 years ago • 11 comments

Describe the problem and steps to reproduce it:

What happened?

Copying multi-line string from the code displayed in code-manager inserts newline between each line.

What did you expect to happen?

No extra newlines.

Anything else we should know?

This could be caused by or related to https://bugzilla.mozilla.org/show_bug.cgi?id=1273836

┆Issue is synchronized with this Jira Task

wagnerand avatar Mar 15 '21 12:03 wagnerand

It may have to do with https://bugzilla.mozilla.org/show_bug.cgi?id=1273836, but I think it also has to do with the fact that the html is in a table. If you do a "paste without formatting" (cmd+shift+v on Mac), I think it resolves the issue. I know that's a bit annoying, but can you give that a try to see if it eliminates the problem?

bobsilverberg avatar Mar 15 '21 14:03 bobsilverberg

Hm, this shortcut does not seem to exist in TextEdit, Firefox or Visual Studio Code?

wagnerand avatar Mar 15 '21 15:03 wagnerand

Hm, this shortcut does not seem to exist in TextEdit, Firefox or Visual Studio Code?

It's not listed in the menu, but it definitely works for me on Mac in Firefox.

bobsilverberg avatar Mar 15 '21 15:03 bobsilverberg

Where do you paste with this shortcut? It has no effect in Slack for me, but pasting some lines in Slack directly creates a code block without newlines, huh (= it works as intended). Now if I open a code block and paste content, I get newlines... (with or without the shortcut above).

willdurand avatar Mar 15 '21 16:03 willdurand

Where do you paste with this shortcut? It has no effect in Slack for me, but pasting some lines in Slack directly creates a code block without newlines, huh (= it works as intended). Now if I open a code block and paste content, I get newlines... (with or without the shortcut above).

It works for me in both Gmail and Google Docs. I guess YMMV, depending on where you are pasting it.

bobsilverberg avatar Mar 15 '21 16:03 bobsilverberg

I am mostly pasting into Slack in Firefox and Visual Studio Code.

wagnerand avatar Mar 15 '21 16:03 wagnerand

I am mostly pasting into Slack in Firefox and Visual Studio Code.

I tried pasting into VS Code and I cannot reproduce the issue. It doesn't add any line breaks for me. What OS are you on, and can you give me a link to a particular file that I can use to try to reproduce?

bobsilverberg avatar Mar 15 '21 17:03 bobsilverberg

I tried pasting into VS Code and I cannot reproduce the issue. It doesn't add any line breaks for me. What OS are you on, and can you give me a link to a particular file that I can use to try to reproduce?

Which content are you copying?

MacOS, any content in pretty much any browse pages.

willdurand avatar Mar 15 '21 20:03 willdurand

I tried pasting into VS Code and I cannot reproduce the issue. It doesn't add any line breaks for me. What OS are you on, and can you give me a link to a particular file that I can use to try to reproduce?

Which content are you copying?

MacOS, any content in pretty much any browse pages.

Ah, I was using the Compare page. For some reason I thought that was what was being described. I can reproduce with the Browse page. 😞

bobsilverberg avatar Mar 15 '21 22:03 bobsilverberg

It's a bit odd that it's not a problem with the Compare page yet it is a problem with the Browse page, as both pages use a table. It's worth digging into a bit more.

bobsilverberg avatar Mar 15 '21 22:03 bobsilverberg

Oh, I didn't realize the Compare page is not affected, interesting!

wagnerand avatar Mar 16 '21 13:03 wagnerand