mod_full_brace_for

Add or remove braces on a single-line 'for' statement.

Possible values are ignore, add, remove and force, default is ignore.

Examples

add

Before

for (int i=0; i<x; i++)
  sum = sum+i;

for (int i=x-1; i>0; i--) sum = sum-i;

after

for (int i=0; i<x; i++) {
  sum = sum+i;
}

for (int i=x-1; i>0; i--) {sum = sum-i;}

Note it does not add any newlines; there is nl_for_brace option to control this.

remove

Before

for (int i=0; i<x; i++) {
  sum = sum+i;
}

for (int i=x-1; i>0; i--) {sum = sum-i;}

after

for (int i=0; i<x; i++)
  sum = sum+i;

for (int i=x-1; i>0; i--) sum = sum-i;

See also