Not sure if this deserves a new topic. Anybody any idea how I can prevent the array formatting from doing the below.
void someFunc()
{
byte a[] = { 0, 0x5e, 0x52, 0x52, 0x52, 0x52, 0x5e, 0, }; //makes 10
}
After autoformat
void someFunc()
{
byte a[] = {
0,
0x5e,
0x52,
0x52,
0x52,
0x52,
0x5e,
0,
}; //makes 10
}
The cause is the last comma before the } in the array initialisation.
I did search the documentation (Clang-Format Style Options — Clang 14.0.0 documentation ) for 'array' but did not spot anything that immediately said "that's it". My .clangformat is attached.
.clang-format.zip (1.6 KB)
J-M-L
September 19, 2022, 6:17am
2
Tried playing with Cpp11BracedListStyle (set to true or false)?
Can’t try at the moment
Tried that now, thanks. Made no difference Maybe in combination with something else but unless you need the challenge ( ), you can leave it.
I know the work around. It's mostly for when I autoformat a poster's code that it annoys the crap out of me; undo, remove the commas and autoformat again.
J-M-L
September 19, 2022, 8:20am
4
may be AllowAllArgumentsOnNextLine
as it applies to braces too and change ColumnLimit
?
annoying I agree !
system
Closed
March 18, 2023, 8:21am
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.