Vscode: When you copy a line without any selection the \n should not be copied

Created on 26 Oct 2018  路  8Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.28.2
  • OS Version: OSX 10.13.6

related bug: https://github.com/Microsoft/vscode/issues/40695

Steps to Reproduce:

  1. In the editor put cursor on a line and hit CTRL+C.
  2. Now go the place you want paste the content and position the cursor in for example in the middle of two parenthesis.
  3. Hit CRTL+V. You would expect the content to be pasted in between your two parenthesis. But it will create a new line on top of where you position the cursor and paste the line there.

This is the default behavior of IntelliJ and PyCharm and it is really convenient. Copying one line of text generally means only the content of that line no the \n at the end.

Does this issue occur when all extensions are disabled?: Yes. same result without any extensions.

editor-clipboard feature-request

Most helpful comment


This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

All 8 comments

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

Not all editors behave the same in this case. I think perhaps an option could be introduced to tweak the behaviour.

@alexdima Any progress on this? I would like an option to disable adding new line on paste. It takes a lot of time to remove the new line after paste.

@yubaoquan Can my answer on stack help ?

@yubaoquan Can my answer on stack help ?

I've read this answer, but I dont want to remember a new key combination. What's more, it will import more key presses since I copy line a lot during coding.

Thanks.

I am pretty sure that in the past, when I copied a line without selection, then pasted that, then a new line would get pasted, but after the cursor position. That made sense and I was happy.

Now for some reason the pasted line appears above and that's really weird.

E.g.:

  1. Copy a line without selection using Cmd + C
  2. Place cursor here:
222 <CURSOR>
333
  1. Hit Cmd + V

Expected result:

222
<COPIED LINE>
333

Actual result:

<COPIED LINE> <--- Why here?!
222
333


This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Hi and thank you. Before I vote, can I see a final confirmation of what I'm voting for?

  • Am I voting for the pasted content going on the line above my cursor?
  • Am I voting for the pasted content going where my cursor currently is?
Was this page helpful?
0 / 5 - 0 ratings

Related issues

shanalikhan picture shanalikhan  路  3Comments

omidgolparvar picture omidgolparvar  路  3Comments

trstringer picture trstringer  路  3Comments

ryan-wong picture ryan-wong  路  3Comments

chrisdias picture chrisdias  路  3Comments