home  

pp_indent_brace

Properties

  Category: Preprocessor options
      Type: numeric [-1 .. 1]
   Default: 1

Description

How to indent braces directly inside #if, #else, and #endif.
Requires pp_if_indent_code=true and only applies to the indent of the
preprocessor that the braces are directly inside of.
 0: No extra indent
 1: Indent by one level
-1: Preserve original indentation

Default: 1

Examples

raw CPP code pp_indent_brace=-1 pp_indent_brace=0 pp_indent_brace=1
/*-- this is the default sample --*/ int main(int argc, char** argv){ int n = 0; if(arg>=1){ printf("Hello %s!\n", argv[1]); n=strlen(argv[1]); }else{ puts("Hello world!"); } return n; } /*-- this is the default sample --*/ int main(int argc, char** argv){ int n = 0; if(arg>=1){ printf("Hello %s!\n", argv[1]); n=strlen(argv[1]); }else{ puts("Hello world!"); } return n; } /*-- this is the default sample --*/ int main(int argc, char** argv){ int n = 0; if(arg>=1){ printf("Hello %s!\n", argv[1]); n=strlen(argv[1]); }else{ puts("Hello world!"); } return n; } /*-- this is the default sample --*/ int main(int argc, char** argv){ int n = 0; if(arg>=1){ printf("Hello %s!\n", argv[1]); n=strlen(argv[1]); }else{ puts("Hello world!"); } return n; }
 

Not the best code for this option? See how to improve the .uds file used to generate these examples.