Fix uncrustify formatting for lambda expression
I would like to homogenize Qt Creator and uncrustify formatting for lambda expression.
Writing the following code with Qt Creator gives the following format:
connect(this, &MyObject::mySignal, [&] {
qDebug() << "test lambda uncrustify formatting";
});
But when formatting the code with uncrustify, I have the following output:
connect(this, &MyObject::mySignal, [&] {
qDebug() << "test lambda uncrustify formatting";
});
Is there an uncrustify parameter that flattens the code like my Qt Creator example?
source to share
Maybe you are looking for indent_align_paren=false
? At least using this seems to give the expected results.
If it breaks non-lambdas ... so what does Qt Creator do?
// (A)
connect(this, &MyObject::mySignal,
functor);
// (B)
connect(this, &MyObject::mySignal,
functor);
If it gives you (B), it indent_align_paren=false
won't do what you want, and Qt Creator's formatting ... is questionable. (In this case, I suppose you should file a function request against uncrustify, or a bug report in Qt Creator.) If it gives you (A), then you want indent_align_paren=false
more than just lambda expressions.
source to share