How to reset code formatting with Uncrustify

I am using Uncrustify to formatting my C++ code and I am making some experiments with infinite list of settings.

Because of some bad settings my code now has a lot of new line that split statement in more lines (mostly due to a short line width).

I would like to reformat the code in order to have one statement per line and reformat it in another way.

How can I do it?

Answers

There is no undo function in Uncrustify and if your SCM can not help you, you are unfortunately out of luck.

Regarding to the newlines, which seem to cause the most problems for you, you could try to remove and reapply them with the 'nl_remove_extra_newlines' option (see a short discussion about it in the uncrustify issue #994) in combination with other options that are influencing newlines.

Posted on by CDanU