How do I stop Visual Studio from automatically adding the end-of-comment characters when I start a new comment in a CSS file
comments, css, visual-studio-2012
Solution
I'm afraid there isn't an option to change this in Visual Studio, at least not one I can see. I've had the same issue sometimes, and generally use three ways around it:
- Select the lines to comment out and use the keyboard shortcut: CTRL+K, C
- Cut the closing */ and paste it at the end of the location
- Press CTRL+Z to undo the closing */
The first is the best method, but if I've already started typing 2 or 3 are enough to get through the break in flow!
Problem
In Visual Studio 2012, when I want to comment out one or more lines in a CSS file using the `/*` and `*/` characters, VS always automatically adds the closing comment characters `*/` right after I type the starting comment characters. So if I start with this block of code: ``` .appGrid { display: -ms-grid; -ms-grid-columns: 120px 1fr; -ms-grid-rows: 140px 80px 1fr; } ``` and I want to comment out the `-ms-grid-rows` line, I type `/*` at the beginning of that line. This is what I want to see: ``` .appGrid { display: -ms-grid; -ms-grid-columns: 120px 1fr; /* -ms-grid-rows: 140px 80px 1fr; } ``` Instead, VS adds the `*/` characters as soon as I finish typing the `/*` characters, like this: ``` .appGrid { display: -ms-grid; -ms-grid-columns: 120px 1fr; /**/ -ms-grid-rows: 140px 80px 1fr; } ``` I then have to manually delete the automatically-added `*/` and re-add it where I actually want it...in this case at the end of the line I'm trying to comment out. How can I stop VS from automatically adding the `*/` characters? I couldn't find any option to disable this behavior in Tools>Options>TextEditor>CSS. For reference, I'm using VS2012 Premium.