Ctrl-c in Visual Studio 2012 will copy empty rows to empty the Clipboard

Source: Internet
Author: User
Tags visual studio

The scenario where this problem can easily occur is as follows:

Ctrl-c copy a piece of code (Ctrl-x is the same problem)

The cursor moves to the blank line position where you want to paste the code (typically pasted on a blank line)

Hold down the CTRL key, and when you are ready to press the V button, a distraction or a shake of the hand, the finger falls on the C key.

You come back to see, nothing is pasted out, just move the cursor down one line.

You think you did not press the key, and then several consecutive ctrl-v, see the cursor down one line, still nothing.

At this point, if you know Shift-ctrl-v (cycle Clipboard Ring) This shortcut, may not be how angry, press two shift-ctrl-v will be able to solve the problem, but if you do not know the shortcut, you will be very annoyed, can only be reproduced, if it is cut, Your irritation will double.

In July 2011, someone on Microsoft's visualstudio.uservoice.com website has fed back the question:

Stop processing CTRL + C on empty selections

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/

After copying a large chunk of the "clipboard with CTRL + C, I move the" cursor to "correct spot in another file a D paste it with Ctrl + V. Oh wait, except instead of CTRL + V my fingers hit Ctrl + C. Even though I didn ' t highlight any new text, the editor threw me entire careful in the Clipboard and garbage it W ith the current line, forcing me to go back to the other file which I might have from now. This is a EXTREME pain in the backside, something I can ' t turn off (the existing setting only claims to work on Blank Lin Es, and doesn ' t even get-right), and something that Visual C + + never used to do before visual Studio. NET or whatever You call this. Would I have to write a extension that stops the editor from mindlessly performing the copy hotkey in any text that isn ' t Even selected?

Microsoft has not ignored this feedback and provided solutions in VS2012 (found on StackOverflow):

It ' s not copying a empty block, it's copying the blank line. Can change this setting into Tools > Options > Text Editor > All Languages > ' Apply/Copy Commands to Blank lines when there is no selection '.

The workaround is simple, just cancel the option of ' Apply cut or Copy Commands to blank lines when there is no selection '.

Although it is not possible to understand why there is a need to replicate empty lines, if so, it is acceptable.

However, why the default setting is to copy empty lines, which is contrary to everyone's daily operating habits. In the editor I used, I didn't encounter an editor that would copy empty rows in addition to Visual Studio, even if it was a notepad from Windows. This really can't understand!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.