diazoxide
diazoxide

Reputation: 120

Visual Studio C++ code how to autoindent preprocessor directives

How to use autoindent the preprocessor directives

For example in Visual studio all preprocessor directives intended like this

void test(){
#if _SOME_VAR
    std::cout << "test" << std::endl;
#if _SOME_VAR2
      std::cout << "test2" << std::endl;
#endif
#endif
}

How can i make code auto indents like this

void test(){
  #if _SOME_VAR
    std::cout << "test" << std::endl;
    #if _SOME_VAR2
      std::cout << "test2" << std::endl;
    #endif
  #endif
}

Upvotes: 1

Views: 630

Answers (1)

diazoxide
diazoxide

Reputation: 120

The solution is

Tools->Options->Text Editor->Indentation->Position of preprocessor directives

enter image description here

Upvotes: 3

Related Questions