user3161924
user3161924

Reputation: 2309

Stop Visual Studio 2019 from automatically adding comment prefix when enter pressed?

I can't find the option to turn of the VS2019 editor from automatically continuing a comment to the next line. Example:

// This is my comment and when I press enter it gives me:
// 

I don't want it to add the // on enter. Where do I turn that off?

Thanks.

Upvotes: 1

Views: 1893

Answers (2)

x.y.z
x.y.z

Reputation: 66

Navigate to: Tools -> Options -> Text Editor -> C/C++ -> Code Style -> General and uncheck "Insert existing comment style at the start of new lines when writing comments"

Upvotes: 5

Nick
Nick

Reputation: 3950

This feature was added in Visual Studio 2019 16.9.0. You can disable it in Options > Text Editor > C# > Advanced (or search for "comments") by unchecking Insert // at the start of new lines when writing // comments.

enter image description here

Upvotes: 1

Related Questions