When I copy-paste code from Websites (for example: http://www.west-wind.com/Weblog/posts/154812.aspx) Visual Studio 2010 adds a new empty line after every line of code.
How can I prevent this from happening?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should ask the author of that web page to fix it. It is not problem of Visual Studio. Each line of source code on that page is formatted as a new separate paragraph, empty lines are automatically inserted between paragraphs on copying. It is indeed a stupid idea to have each line in its own paragraph, and in addition it uses inline styling with atyle attribute instead of css classes. (This is needed to get rid of those empty lines in web browser.)
I tried Internet Explorer and Firefox and they both put the text with empty lines to clipboard, so you have no chance to get it easily copied without empty lines regardless of which target editor you use. You need to do some tricks. Or ask the author of that page…