Community
Participate
Working Groups
Created attachment 193625 [details] Eclipse/CDT formatter I'm using CDT on a project where much of the heavy-duty coding is done inside switch statements. The code lines are often very long, so I need intelligent line wrapping to make the code readable. Unfortunately, there seems to be a bug (unless I'm missing something) in the way that line wrapping behaves inside switch statements. I'm using a project-specific formatter that I created that sets line wrapping for function calls thusly: Line wrapping policy: Wrap all elements, except first element if not necessary Indentation policy: Indent on column Below is a simple snippet of code, formatted with my project-specific formatter (attached), that demonstrates the problem. Note that for the wrapped statement outside of the switch statement, the second line aligns where you would expect it to -- directly under the first function argument in the line above. Then note that for the wrapped line within the switch statement, the second line is offset 3 spaces to the left of where it "should" be. ------------------------- int main(void) { int c; assign( hiResult, unop( Iop_ReinterpF64asI64, binop( Iop_AddF64, mkexpr( frA ), mkexpr( frB ) ) ) ); switch (c) { case 0: assign( hiResult, unop( Iop_ReinterpF64asI64, binop( Iop_AddF64, mkexpr( frA ), mkexpr( frB ) ) ) ); break; default: printf("not found"); } return; } --------------------------
This seems to work for me with 7.0.2 and HEAD. Maybe you need to provide a more complete source sample.