views:

463

answers:

5

I have somehow misconfigured fingers. This leads to a very annoying situation.

  1. I select a block of text to copy;
  2. I move the cursor the place where I want to paste the code;
  3. I accidentally press Ctrl+C again instead of Ctrl+V;
  4. My block of copied text is replaced by an empty block;
  5. I have to go back and do it all over again. Grrrrr.

Is there any way to disable this behavior, that is to disable copy of empty blocks of text in Visual Studio 2005+?

+3  A: 

Press CTRL+SHIFT+V twice.

Magnus Johansson
this is what i do. it's nice in general, even if i have other things copied. i just cycle through my clipboard
Darren Kopp
+13  A: 

It's not copying an empty block, it's copying the blank line. You can change this setting in Tools > Options > Text Editor > All Languages > 'Apply Cut or Copy Commands to blank lines when there is no selection'

John Sheehan
+2  A: 

I'm using Visual Studio 2008 (but I believe this answer applies to Visual Studio 2005).

Select Tools -> Options.

Navigate to the "Text Editor" node and expand it.

Expand "All Languages" (or whatever language you want to apply this to) and check the "Apply Cut or Copy commands to blank lines when there is no selection".

Jeremy Wiebe
A: 

The option that saved my sanity is found in Tools - Options - Text Editor - All Languages - General. There's a checkbox Apply Cut or Copy commands to blank lines when there is no selection. Unchecking this allowed me to hit Ctrl+C all i want on a blank line without losing the content on my clipboard.

Source

EndangeredMassa
A: 

Go to Tools > Options > Text Editor > All Languages > General

The option on that page is "Apply Cut or Copy commands to blank lines when there is no selection"

dcstraw