Hi,
I found two bugs with the formatting of two if-else statement.
The params are
nl_if_leave_one_liners=true
nl_after_semicolon=true
nl_after_brace_open=false
nl_if_brace=force
nl_brace_else=force
nl_elseif_brace=force
nl_else_brace=force
nl_else_if=remove
if(x){statement;} else{statement;}
formated to
if (x) statement; else statement;
instead of
if (x) statement; else statement;
if(x) { statement; statement; } else statement;
formatted to
if (x) { statement; statement; } else {statement; }
instead to
if (x) { statement; statement; } else { statement; }
I was using UniversalIndentGUI and then tried to use uncrustify on the command line but got the same issue. Attached config file, source code with the two examples and a file how it should be at the end.
Regards
Sandro
Note: With the parameters set like described a lot of other if-else examples work as expected, this two were the only ones I found which didn't worked as expected
please use the option:
nl_if_leave_one_liners=false
checked all my different if cases, they are all ok now. Thank you for your help :-)
Last edit: Sandro Piras 2015-11-24