共用方式為


Visual Studio 2013: Never Cut or Copy a Blank Line Again

Ever cut something then accidentally cut a blank line?  I can't really think of a good reason to cur or copy a blank line and yet you are still allowed to do it. 

 

The good news is you can keep this from happening by simply going to Tools -> Options -> Text Editor -> All Languages -> General and deselecting the "Apply Cut or Copy commands to blank lines when there is no selection" checkbox:

5-16-2012 1-08-44 PM

 

Note: This will prevent using Shift+DEL to delete an empty line so you will have to enable the feature if you use Shift+DEL.

Comments

  • Anonymous
    September 11, 2013
    Not sure why this is associated with VS 2013 while it is available in VS 2012 as well.

  • Anonymous
    September 11, 2013
    Hey Arun :) I forgot to put in the disclaimer that these are older features. This particular one goes back at least to 2005 and possibly further. Z

  • Anonymous
    January 30, 2014
    I really wish you could still use shift delete, but just not wipe the clipboard. I don't see why they have to go hand in hand.