

So, even if some tabs or spaces are inserted in front of the comment, they are automatically wiped out if Ctrl+K,D is applied, simply because there is

I should clarify that I would like to preserve the rest of the functionality of Ctrl+K,D.Įdit: I'm afraid that all the guidelines mentioned in Managing Code Formatting provided below by Seth, simply force the application of the instructions already set in text editor for every specific language (and in particular c#) <- comment is properly auto alignedĪn eventual 2nd comment on a new line, remains aligned with the one above, which indicates that the editor can adjust the position of comment lines based on certain criteria. On the other hand, when a comment is placed following a code line, as below: |-code line -|- white space -| //.1st comment line. So that it doesn't interfere with the code below or above, when pressing Ctrl+K,D the comment is shifted left, to align with the surrounding code. I would like my comments to stay at the position placed, regardless of the code position above or below.įor example, when writing a comment on a new line starting say at col 60 as below: code line Is there a way to stop Visual Studio text editor (2015 or 2017) from auto moving the comment lines when pressing Ctrl+K,D or relevant key stroke (Ctrl+E,D - format entire document) ?
