home  

nl_after_if

Properties

  Category: Newline adding and removing options
      Type: multiple (ignore add remove force)
   Default: ignore

Description

Add or remove blank line after 'if' statement. Add/Force work only if the
next token is not a closing brace.
if(...){
  ...
} else {
  ...
}

var = 0;

Examples

raw CPP code nl_after_if=ignore nl_after_if=add nl_after_if=remove nl_after_if=force nl
nl_after_if=force
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; } 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; } 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; } 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; } 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; } 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; }
 

Info

  BUG the position where nl_after_if takes effect is not visible.
  Edited by JEAYNE

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