Community
Participate
Working Groups
Build ID: I20080617-2000 Steps To Reproduce: Example: before ------ struct foo { uint32_t foo_a; uint8_t foo_b; uint64_t* foo_c; struct really_long_name* foo_d; }; after ----- struct foo { uint32_t foo_a; uint8_t foo_b; uint64_t* foo_c; struct really_long_name* foo_d; }; It would also be OK to line up everything with foo_d, but it would be fancy if a couple long poles didn't throw off the formatting for everything (off the top of my head, I would suggest calculating the average displacement required to line up the element and then not including elements that are more than one or two standard deviations from the average...but this may be overly-complicated). Example 2: before ------ enum baz { BAZ_FLOOBLE = 82, /* Blah blah */ BAZ_GARBLE = 49, /* Blah blah */ BAZ_FARGWITZ = 19, /* Blah blah */ }; after ----- enum baz { BAZ_FLOOBLE = 82, /* Blah blah */ BAZ_GARBLE = 49, /* Blah blah */ BAZ_FARGWITZ = 19, /* Blah blah */ }; Two other things to note from this example: 1) Obviously, enum values need to be lined up at the equal sign. 2) Comments trailing the values may need to be realigned (this applies to structs/#defines as well. Thanks! Nathan More information:
This is already available for JDT as 'Align items in columns' (previously 'Align fields in columns'), see https://www.eclipse.org/eclipse/news/4.9/jdt.php#align-spaces so could be a good start for the CDT implementation.