home  

align_nl_cont

Properties

  Category: Code alignment options (not left column spaces/tabs)
      Type: numeric [0 .. 3]
   Default: 0

Description

Whether and how to align backslashes that split a macro onto multiple lines.
This will not work right if the macro contains a multi-line comment.

0: Do nothing (default)
1: Align the backslashes in the column at the end of the longest line
2: Align with the backslash that is farthest to the left, or, if that
   backslash is farther left than the end of the longest line, at the end of
   the longest line
3: Align with the backslash that is farthest to the right

Examples

raw CPP code align_nl_cont=0 align_nl_cont=1 align_nl_cont=2 align_nl_cont=3
/*-- 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; } /*-- 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.