Pasting with newline right after comments is commenting the pasted code
Answered
In the last versions of the IDE I noticed I can't paste snippets as I was used to.
My way was to select blocks of code from the end of their previous line to their end, then place the cursor at the end of the intended previous line and ctrl+v. Lately, if I do that by placing the cursor at a commented line, IDEA will decide to comment all the pasted lines as well, so I have to place a newline, paste, go back up and delete it... or delete the placed "//"s.
I guess it's intended behavior, but for some coding styles it's not very comfortable, and I couldn't find an option to disable it. Can you help me out?
Thank you so much!
Please sign in to leave a comment.
Let me illustrate it with an example of how I'm used to duplicate lines of code. Let's say I have this:
```// Doing stuff
doStuff();```
To duplicate the second line I used to select from the end of the comment to the ; inclusive, then ctrl+c, and then directly ctrl+v to place myself right after the selection and another ctrl+v for the duplicated line. If I do that now, the output would become:
```// Doing stuff
//doStuff();
//doStuff();```
I hope this helps!
This feature was introduced in scope of this request: https://youtrack.jetbrains.com/issue/IDEA-178801
Please feel free to file an issue at YouTrack describing your use-case. Thanks.
Thanks, I already did :)
Since it's a fixed issue it's not taking any attention. Should I post a new one?
Yes please.