Click here to Skip to main content
Click here to Skip to main content

Prevent Cutting or Copying Blank Lines in Visual Studio

, 28 Jun 2012
Rate this:
Please Sign up or sign in to vote.
How to prevent cutting or copying blank lines in Visual Studio

Introduction

I hope you know that we are not required to select a line to cut or copy it in Visual Studio, you can just keep the caret in a line and press Ctrl + C or Ctrl + X and the text in the line will be copied to your clipboard and you can insert this line anywhere in your code by pressing Ctrl + V.

It will also copy a blank line, but people use Ctrl + X command to delete blank lines and some may find this as an issue as they didn’t intend to copy the blank line and also it will clear the previously copied item in the clipboard.

It is surprising as usual to find that Visual Studio team has thought this out and provided a setting which prevents the copying of blank lines, and Cut command will just delete the blank lines.

I found this when I recently bumped into the setting in Visual Studio, in Text Editor > All Languages called "Apply Cut or Copy commands to blank lines when there is no selection".

preventblanklinecopying

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Ashoka RKT
Technical Lead
India India
I am Ashoka (R.K.T.Ashoka), I am a software professional who is passionate about designing and developing software applications. I blog at www.codesmiles.com, I will be writing about .Net & programming.
Follow on   Twitter   LinkedIn

Comments and Discussions

 
QuestionCtrl+J PinmemberSarafian28-Jun-12 20:34 
AnswerRe: Ctrl+J PinmemberRKT.Ashoka29-Jun-12 2:11 
GeneralRe: Ctrl+J PinmemberSarafian29-Jun-12 2:30 
GeneralAlternative Pinmemberperilbrain28-Jun-12 5:44 
GeneralRe: Alternative PinmemberRKT.Ashoka28-Jun-12 6:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 28 Jun 2012
Article Copyright 2012 by Ashoka RKT
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid