How to avoid copying a blank line in Visual Studio

Many times I find myself copying some piece of code, then positioning in a blank line where I want to paste it, and then mistakenly pressing Ctrl+C again instead of Ctrl+V. This copies a blank line to the clipboard overwriting what I had originally copied, so when I finally manage to paste it, it is not what I wanted.

It was a great surprise to discover that this behavior is configurable in Visual Studio:

Just go to Tools/Options/Text Editor/All Languages, and uncheck the box where it says “Apply Cut or Copy commands to blank lines when there is no selection”.



Thanks Scott Cate for a great source of Visual Studio tricks !!

No Comments