0

How can I configure, if possible, Uncrustify to format the following code

MyObject obj;
obj.a_func_returning_another_object().get_a_pointer_function()->do_stuff();
AnotherObject* objPointer = new AnotherObject();
anObject->fooObj().barMember().done();

like this?

MyObject obj;
obj.a_func_returning_another_object()
   .get_a_pointer_function()
   ->do_stuff();
AnotherObject* objPointer = new AnotherObject();
anObject->fooObj()
        .barMember()
        .done();

Especially, if the source member name (in this case obj) varies?

Using indent_member=N always indents by N spaces, which does not take the source member's name into account.

Bonus: Can this line-breaking behavior be configured to only take action if the code_width option forces a line break?

Torbjörn
  • 5,512
  • 7
  • 46
  • 73

0 Answers0