In Visual Studio 2010, I have multiple lines of text to be commented:
A B C
Using CTRL+E+C to comment out multiple lines, I get
//A //B //C
I would like to have a space (or indent) between // and A, hence // A
instead of //A
.
However, after I group tab a block of text and indent it, CTRL+E+C no longer comments out the selected text.
How to group comment and get the following:
// A // B // C
Pressing Ctrl+K+C or Ctrl+E+C After selecting the lines you want to comment will not give space after slashes. you can use multiline select to provide space as suggested by Habib
Perhaps, you can use /* before the lines you want to comment and after */ in that case you might not need to provide spaces.
/* First Line to Comment Second Line to Comment Third Line to Comment */
One way to do it would be:
//
and before the Code text. Notice the vertical blue line in the below image( that will appear once the selection is made, then you can insert any number of characters in between them)
I couldn't find a direct way to do that. The interesting thing is that it is mentioned in the C# Coding Conventions (C# Programming Guide) under Commenting Conventions.
Insert one space between the comment delimiter (//) and the comment text
But the default implementation of commenting in visual studio doesn't insert any space
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With