How to disable auto distance * after type in Visual Studio 2017?

When I want to print something like

Type* name; 

at some point during line input (as soon as I type a semicolon), VS2017 automatically solves the space in

 Type * name; 

After I deleted the space for the first time, the IDE has not tried this again for some time. The behavior started again for some reason, when I typed a pointer type variable, but immediately typing another line like this, I didn’t repeat the authorization ...

After some testing, auto-spacing seems to occur in a class where the first line of code after the access specifier becomes a victim if it matches Type* name; .

 class Foo { private: Type* name; //Becomes Type * name; after typing the ';' public: Type2* name2; //Here as well }; 

I do not like it. How can I put an end to this blasphemy?

+8
source share
2 answers

Go to Tools-> Options, then Text Editor-C> / C ++ → Format-> Interval and view the options, however I do not believe that this element is customizable.

+3
source

In the menu "Tools"> "Options"> "TextEditor"> C ++> "Formatting"> "Interval"> "Interval for statements"> "Binary operators" switch the checkbox from " Insert spaces before and after binary operators" to " Do not change spaces around binary operators . "

0
source

Source: https://habr.com/ru/post/1274312/


All Articles